Skip to content

Instantly share code, notes, and snippets.

@benjiqq
benjiqq / gist:6449799
Created September 5, 2013 13:02 — forked from idan/gist:3135754

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@benjiqq
benjiqq / java_cheat
Last active December 24, 2015 12:49
Javascript cheat sheet
//Math
Math.round(.6)
Math.random( )
Math.PI
Math.sin(0)
//Strings
var s = "hello world"
s.charAt(0)
s.charAt(s.length-2)
@benjiqq
benjiqq / rfc
Last active December 25, 2015 05:29
RFCs for the internetz
DNS
http://tools.ietf.org/html/rfc1035
Updated by: 1101, 1183, 1348, 1876, 1982, 1995,
1996, 2065, 2136, 2181, 2137, 2308,
2535, 2673, 2845, 3425, 3658, 4033,
4034, 4035, 4343, 5936, 5966, 6604
websockets
http://tools.ietf.org/html/rfc6455
@benjiqq
benjiqq / bitcoindev
Last active December 25, 2015 05:49
Bitcoin dev references
https://en.bitcoin.it/wiki/Category:Technical
https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery
https://de.bitcoin.it/wiki/API-Referenz_(JSON-RPC)
https://en.bitcoin.it/wiki/Protocol_specification
@benjiqq
benjiqq / poweroff_vagrant.py
Last active December 25, 2015 08:38
power off all vagrant boxes
#!/usr/bin/env python
import argparse
import re
import os
import subprocess
try:
import json
except ImportError:
import simplejson as json
@benjiqq
benjiqq / vagrant_minimal
Created October 15, 2013 20:56
minimal vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.provision :shell, :path => "bootstrap.sh"
@benjiqq
benjiqq / django_require.txt
Created October 31, 2013 13:14
django standard requirements
BeautifulSoup==3.2.1
Django==1.4.8
South==0.7.6
requests==1.2.3
Fabric==1.7.0
@benjiqq
benjiqq / git emacs
Created November 5, 2013 10:56
git emacs
;(tool-bar-mode -1)
;(setq inhibit-startup-message t)
(define-key key-translation-map (kbd "M-8") (kbd "["))
(define-key key-translation-map (kbd "M-9") (kbd "]"))
(define-key key-translation-map (kbd "M-6") (kbd "{"))
(define-key key-translation-map (kbd "M-7") (kbd "}"))
;(add-to-list 'load-path "~/devtools/emacs/color-theme/")
@benjiqq
benjiqq / sshtrouble
Last active January 1, 2016 13:08
ssh trouble
#links
#https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git
#https://confluence.atlassian.com/display/BITBUCKET/Troubleshoot+SSH+Issues
#http://security.stackexchange.com/questions/20706/what-is-the-difference-between-authorized-key-and-known-host-file-for-ssh
#http://serverfault.com/questions/132970/can-i-automatically-add-a-new-host-to-known-hosts
#http://en.wikibooks.org/wiki/OpenSSH/Client_Configuration_Files#.7E.2F.ssh.2Fknown_hosts
https://help.ubuntu.com/10.04/serverguide/openssh-server.html
https://help.ubuntu.com/community/SSH/OpenSSH/Configuring
@benjiqq
benjiqq / bitcoinblocks
Last active January 1, 2016 13:48
print blocks
/*
blockhash 0 is 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
blockhash 1 is 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
blockhash 2 is 000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd
blockhash 3 is 0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449
blockhash 4 is 000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485
blockhash 5 is 000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc
blockhash 6 is 000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d
blockhash 7 is 0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444
blockhash 8 is 00000000408c48f847aa786c2268fc3e6ec2af68e8468a34a28c61b7f1de0dc6