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
// export { default as Tap } from "./Tap"; | |
// export { default as DoubleTap } from "./DoubleTap"; | |
// export { default as Swipe } from "./Swipe"; | |
const { ccclass, property } = cc._decorator; | |
@ccclass | |
export default class Toucher extends cc.Component { | |
@property |
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
// Learn TypeScript: | |
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html | |
// Learn Attribute: | |
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html | |
// Learn life-cycle callbacks: | |
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html | |
const { ccclass, property } = cc._decorator; | |
@ccclass |
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
// 需要设置正确的 token | |
var token = 985700508; | |
// 开始时间 [年,月,日,时] , 设置为null, 则为今天的整点时刻往前7天. | |
var startTime = null; // [2019, 4, 28, 14]; | |
// 结束时间 [年,月,日,时] , 设置为null, 则为今天的整点时刻. | |
var endTime = null; // [2019, 5, 5, 14]; | |
// 关键字 (微信有bug, 不是所有出现在错误信息里的字符串都能被检索) |
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
#!/bin/bash | |
CURRENT=$PWD | |
echo $CURRENT | |
function ergodic(){ | |
if [ -n "$1" ] ;then | |
echo '>>>>>> ENTER [' $1 '] >>>>>>' | |
cd $1 | |
else |
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
// From http://baagoe.com/en/RandomMusings/javascript/ | |
function Alea() { | |
return (function(args) { | |
// Johannes Baagøe <[email protected]>, 2010 | |
var s0 = 0; | |
var s1 = 0; | |
var s2 = 0; | |
var c = 1; | |
if (args.length == 0) { |
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
// From http://baagoe.com/en/RandomMusings/javascript/ | |
function Alea() { | |
return (function(args) { | |
// Johannes Baagøe <[email protected]>, 2010 | |
var s0 = 0; | |
var s1 = 0; | |
var s2 = 0; | |
var c = 1; | |
if (args.length == 0) { |
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
export TERM=xterm-color | |
# for color | |
export CLICOLOR=1 | |
export LSCOLORS=gxfxaxdxcxegedabagacad | |
# grep | |
alias grep='grep --color=always' | |
export COLOR_NC='\\e[0m' # No Color | |
export COLOR_WHITE='\\e[1;37m' |
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
# NewFileAtCurrentFolder | |
import sublime_plugin | |
import os.path | |
class NewFileListener(sublime_plugin.EventListener): | |
def on_new_async(self, view): | |
if not view.window().active_view(): | |
print("NF: no view") | |
return |
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
/** | |
* Detecting vertical squash in loaded image. | |
* Fixes a bug which squash image vertically while drawing into canvas for some images. | |
* This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel | |
* | |
*/ | |
function detectVerticalSquash(img) { | |
var iw = img.naturalWidth, ih = img.naturalHeight; | |
var canvas = document.createElement('canvas'); | |
canvas.width = 1; |
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
#!/bin/bash | |
# Please run this shell with "sudo ..." | |
SERVICE=Wi-Fi | |
# You could change the service. List all network services via: | |
# networksetup -listallnetworkservices | |
echo "" | |
echo "Current DNS on ${SERVICE}:" |
NewerOlder