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 build | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type visit struct { | |
| a1 uintptr | |
| a2 uintptr |
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
| func deepCopy(rv reflect.Value) reflect.Value { | |
| switch rv.Kind() { | |
| case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128, reflect.String: | |
| return rv | |
| case reflect.Slice: | |
| if rv.IsNil() { | |
| return rv | |
| } | |
| sliceCpy := reflect.MakeSlice(rv.Type(), rv.Len(), rv.Cap()) | |
| for i := 0; i < sliceCpy.Len(); i++ { |
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
| #!/bin/bash | |
| sed ':a;N;$!ba;s/\(.\{279\}\)\n/\1@#@\n/g' $1 | sed 's/^\[[^]]*\]//g' | sed 's| "<autogenerated>:334: ||g' | sed 's/", source: chrome-extension:\/\/[a-zA-Z0-9.\/]* ([0-9]*)//g' | sed ':a;N;$!ba;s/@#@\n//g' |
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
| var OrigError = Error; | |
| window.Error = function(arg1,arg2,arg3,arg4,arg5,arg6) { | |
| console.log('caught error: ', arg1, arg2,arg3,arg4,arg5,arg6); | |
| console.log(new OrigError().stack) | |
| return new OrigError(arg1,arg2,arg3,arg4,arg5,arg6); | |
| }; |
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
| for pp in $(grep -r "INITIAL" . | awk -F':' '{print $1}' |sort | uniq); do sed -i 's/INITIAL/FINAL/g' $pp; done |
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
| [ | |
| { | |
| "Origin": "SFO", | |
| "Dest": "HKG", | |
| "Outbound": { | |
| "DayOfWeek": "Saturday", | |
| "DateAdjust": "PlusMinusTwoDays" | |
| }, | |
| "Return": { | |
| "DayOfWeek": "Sunday", |
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
| var oldRequestAnimationFrame = window.requestAnimationFrame; | |
| window.requestAnimationFrame = function(cb) { | |
| var numExtra = 60; | |
| oldRequestAnimationFrame(function(time) { | |
| for (var i = 0; i < numExtra; i++) { | |
| cb(time + 60*1000) | |
| } | |
| }); | |
| }; |
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 main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "unicode" | |
| "strings" | |
| ) | |
| const noRepeatFirstLetter = true |
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> | |
| window.addEventListener('message', function(event) { | |
| console.log('iframe: Got postmessage in origin ' + location.origin + ' from origin: ' + event.origin + '(' + event.data + ')'); | |
| }); | |
| window.addEventListener('dispatchToIframe', function() { | |
| console.log('iframe: Got dispatchEvent() in origin ' + location.origin + '(from index.html)'); | |
| }); | |
| setTimeout(function() { | |
| window.dispatchEvent(new CustomEvent('dispatchFromIframe')); |
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 main | |
| import ( | |
| "encoding/binary" | |
| "encoding/hex" | |
| "flag" | |
| "fmt" | |
| "log" | |
| ) |
OlderNewer