This file contains 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
// Get binary file using XMLHttpRequest | |
function getBinary(file) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", file, false); | |
xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
xhr.send(null); | |
return xhr.responseText; | |
} | |
// Base64 encode binary string |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
set -xg PYTHONPATH /opt/eleccion/ $PYTHONPATH | |
set -xg PYTHONPATH /opt/operaciones/ $PYTHONPATH | |
set -xg GOROOT /usr/local/go $GOROOT | |
set -xg PATH /usr/local/go/bin $PATH | |
set -xg EDITOR vim $EDITOR | |
setenv EDITOR vim | |
function l | |
ll $argv |
This file contains 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 main | |
import ( | |
"io" | |
"log" | |
"net/http" | |
) | |
func main() { |
This file contains 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
var SceneA = new Phaser.Class({ | |
Extends: Phaser.Scene, | |
initialize: | |
function SceneB () | |
{ | |
Phaser.Scene.call(this, 'sceneA'); |
This file contains 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
var SceneA = new Phaser.Class({ | |
Extends: Phaser.Scene, | |
initialize: | |
function SceneB() { | |
Phaser.Scene.call(this, 'sceneA'); | |
this.pic; |
This file contains 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
class Http { | |
public static Inst(): Http { | |
if (null == Http._inst) { | |
Http._inst = new Http(); | |
} | |
return Http._inst; | |
} | |
private static _inst: Http; | |
public constructor() { |
This file contains 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
const listChunk = (list, size = 1, cacheList = []) => { | |
const tmp = [...list] | |
if (size <= 0) { | |
return cacheList | |
} | |
while (tmp.length) { | |
cacheList.push(tmp.splice(0, size)) | |
} | |
return cacheList | |
} |
This file contains 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
const curring = fn => { | |
const { length } = fn | |
const curried = (...args) => { | |
return (args.length >= length | |
? fn(...args) | |
: (...args2) => curried(...args.concat(args2))) | |
} | |
return curried | |
} |
This file contains 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
// 运用正则去掉空格 | |
' s123s'.replace(/^(\s*)(.+)(\s*)$/, '$2') | |
// 日期操作 | |
const dataPattern = (str, format = '-') => { | |
if (!str) { | |
return new Date() | |
} | |
const dateReg = new RegExp(`^(\\d{2})${format}(\\d{2})${format}(\\d{4})$`) | |
const [, month, day, year] = dateReg.exec(str) |
OlderNewer