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
// Run this in the F12 javascript console in chrome | |
// if a redirect happens, the page will pause | |
// this helps because chrome's network tab's | |
// "preserve log" seems to technically preserve the log | |
// but you can't actually LOOK at it... | |
// also the "replay xhr" feature does not work after reload | |
// even if you "preserve log". | |
window.addEventListener("beforeunload", function() { debugger; }, false) |
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
Verifying my Blockstack ID is secured with the address 1F6fE5yVARL1JUuEEKkerF6H3uAHQ8afya https://explorer.blockstack.org/address/1F6fE5yVARL1JUuEEKkerF6H3uAHQ8afya |
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
const e = require("ethereumjs-util") | |
const priv = Buffer.from('you 32 bytes private key', 'hex') | |
const hash = e.sha256("2017-10-07-picops-recertify") | |
const sig = e.ecsign(hash, priv) | |
const pub = e.ecrecover(hash, sig.v, sig.r, sig.s) | |
console.log('v', sig.v) | |
console.log('r', sig.r.toString('hex')) | |
console.log('s', sig.s.toString('hex')) | |
console.log(e.publicToAddress(pub).toString('hex')) |
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
0x75DfEf61A45235C714914f3E279A61922D5c325F |
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
### Keybase proof | |
I hereby claim: | |
* I am detailyang on github. | |
* I am detailyang (https://keybase.io/detailyang) on keybase. | |
* I have a public key whose fingerprint is 035C 5295 6F34 8BE1 932F 2C9A E65A A22D 9E20 503F | |
To claim this, I am signing this object: |
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 is_localhost() { | |
localhost=$(ping -c1 $1 | head -n 1 | grep '127.0.0.1') | |
if [[ -z "$localhost" ]] ; then | |
echo 0; | |
else | |
echo 1; | |
fi | |
} | |
res=$(is_localhost "osx.com"); |
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 | |
# num of error log | |
if [ $1 ];then | |
num=$1 | |
else | |
num=100 | |
fi | |
#today error log name |
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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" |
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
NGINX_ACCESS %{SYSLOGTIMESTAMP:syslog_timestamp}\s*%{SYSLOGHOST:server}\s*%{SYSLOGPROG}:\s*%{IPORHOST:balanced_ip} - - \[%{HTTPDATE}\]\s*"%{WORD:method}\s*%{URIPATHPARAM:request}\s*HTTP/%{NUMBER:http_version}"\s*%{NUMBER:res}\s*%{NUMBER:send_bytes}\s*"(?<referer>.*?)"\s*%{QS:agent}\s*"(?<client_ip>.*?)"\s*%{WORD:unknow}\s*%{QS:cookie}\s*"(?<timestamp>.*?)" |
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
from django.test import TestCase | |
from django.utils import timezone | |
from django.core.urlresolvers import reverse | |
import datetime | |
# Create your tests here. | |
from polls.models import Poll | |
class PollMethodTests(TestCase): | |
def test_was_published_recently_with_future_poll(self): |