This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!(function () { | |
// ai.com console input | |
// 使用方法 q(`long text`) | |
var $ = function (val) { | |
return document.querySelector(val) | |
} | |
window.q = q | |
async function q(longStr) { | |
var sendIndex = 0 | |
var maxOnce = 300 // 每次最多300个中文 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas width="800" height="600" style="border: 1px solid red"></canvas> | |
<script> | |
var canvas = document.querySelector('canvas') | |
var ctx = canvas.getContext("2d") | |
var color1 = [255, 152, 0, 0.5] | |
var color2 = [76, 175, 80, 0.5] | |
var color3 = [33, 150, 243, 0.5] | |
var blended = blend(color1, color2, color3) | |
console.log({ blended }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://browser.primatelabs.com/mac-benchmarks | |
Object.keys($('#mac32').find('tr').map(function() {return $(this).find('.name a').text()}).toArray().map(function(x) {return (/\w+ \d{4}/.exec(x) || [])[0]}).filter(function(x) {return x}).reduce(function(prev, val, key) {prev[val] = 1; return prev}, {})).map(function(x) {return x.split(' ')}).sort(function(x, y) {return x[1] - y[1]}).map(function(arr) {return arr[1] + ' ' + arr[0]}).join('\n') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flash.external.ExternalInterface; | |
public class Log { | |
public static var logs:Array = []; | |
private static const INHERIT:String = 'color:inherit'; | |
private static const PREFIX:String = ''; | |
private static const LS_KEY:String = 'debug'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(fn) { | |
window.$ = fn() | |
}(function() { | |
var $ = function(selector, context) { | |
return new $.fn.init(selector, context) | |
} | |
// var |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- koa style downstream and upstream | |
local thread1 = coroutine.create(function(down) | |
print('thread1-down') | |
coroutine.yield(down) | |
print('thread1-up') | |
end) | |
local thread2 = coroutine.create(function(down) | |
print('thread2-down') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function($, doc) { | |
if (!$ || !$.fn) return | |
var css3 = function() { | |
var style = doc.body.style | |
var test = ['transition', 'webkitTransition', 'MozTransition', 'msTransition'] | |
for (var i = 0, x; x = test[i++];) { | |
if (x in style) { | |
return x | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy from https://github.com/gvangool/node-socks | |
// it is useful but shit code style | |
// save and one day pretty it | |
var net = require('net'), | |
util = require('util'), | |
log = function(args) { | |
//console.log(args); | |
}, | |
info = console.info, | |
errorLog = console.error, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='x' id='markdown'> | |
title | |
=== | |
> blockquote | |
code | |
code2 | |
### head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='x' id='markdown'> | |
title | |
=== | |
> blockquote | |
code | |
code2 | |
### head |
NewerOlder