Skip to content

Instantly share code, notes, and snippets.

View reqshark's full-sized avatar
🪂
ridge soaring

Bent Cardan reqshark

🪂
ridge soaring
View GitHub Profile
@reqshark
reqshark / git.sh
Last active February 17, 2017 09:59 — forked from joannaong/git.txt
git
# damn it!
# committed to the wrong branch again
# fix trigger happy commits to wrong branch:
git reset --soft HEAD^
git checkout branch
git commit
# DELETE TAG
# ----------
@reqshark
reqshark / gist:7d93a23d6447f28fbea10f735a54d778
Last active July 30, 2016 21:21 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@reqshark
reqshark / howitsdone.markdown
Created July 15, 2016 23:49
git style guide opinions

git style guide by reqshark

dont push the big green button (until recently github always did merge commits)!

That's how we get a bunch of noise on the commit log.

here's my workflow for collaborative PR merge on github or bitbucket

same style as nodejs or expressjs collaborative git style

​lets run through an example workflow and of merging a branch called ayyyeeee

@reqshark
reqshark / 2ndtolast.js
Created June 5, 2016 10:33
nanomsg channel
var nano = require('nanomsg')
var pub = nano.socket('pub');
var sub = nano.socket('sub');
var msgs = 0;
var msg1 = 'foo world';
var msg2 = 'bar world';
var msg3 = 'hi world';
var msg4 = 'hello world';
var addr = 'inproc://prefixed';
@reqshark
reqshark / tun.c
Created June 3, 2016 19:40
open tun interface
#include <fcntl.h> /* O_RDWR */
#include <string.h> /* memset(), memcpy() */
#include <stdio.h> /* perror(), printf(), fprintf() */
#include <stdlib.h> /* exit(), malloc(), free() */
#include <sys/ioctl.h> /* ioctl() */
/* includes for struct ifreq, etc */
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if.h>
@reqshark
reqshark / setup.js
Created May 11, 2016 04:28
express boilerplate peepee
const app = require('express')()
const route = require('express').Router()
route.use(require('connect-timeout')('5s'))
route.use(require('body-parser').json())
route.post('/', (req, res) => res.status(200).send('peepee'))
route.get('/', (req, res) => res.status(200).send('poopoo') )
app.use(route)
@reqshark
reqshark / nanomsg-ios.sh
Created April 12, 2016 18:45
build nanomsg pre 1.0 on iOS simulator 7.1
export PREFIX="$(pwd)/nanomsg-ios"
export IOS32_PREFIX="$PREFIX/tmp/ios32"
export IOS64_PREFIX="$PREFIX/tmp/ios64"
export SIMULATOR32_PREFIX="$PREFIX/tmp/simulator32"
export SIMULATOR64_PREFIX="$PREFIX/tmp/simulator64"
export IOS_SIMULATOR_VERSION_MIN=${IOS_SIMULATOR_VERSION_MIN-"7.1"}
export IOS_VERSION_MIN=${IOS_VERSION_MIN-"7.1"}
export XCODEDIR=$(xcode-select -p)
rm -rf nanomsg nanomsg-ios
git clone [email protected]:nanomsg/nanomsg.git
@reqshark
reqshark / keybase.md
Created April 7, 2016 21:42
keybase.md

Keybase proof

I hereby claim:

  • I am reqshark on github.
  • I am req (https://keybase.io/req) on keybase.
  • I have a public key whose fingerprint is 8A26 5BB1 C79C 2660 529F 40C3 A8D1 F458 A07C 689B

To claim this, I am signing this object:

@reqshark
reqshark / raspitest.sh
Created April 7, 2016 15:38
first try compiling libmill node module on raspi
pi@raspberrypi:~/o/mill $ make check
make[1]: Entering directory '/home/pi/o/mill'
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | arm
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make[2]: Entering directory '/home/pi/o/mill/build'
make[2]: Nothing to be done for 'all'.
@reqshark
reqshark / localefix.sh
Created April 7, 2016 15:35
get rid of perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8"
$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=ru_RU.UTF-8
LC_MESSAGES="en_US.UTF-8"