Skip to content

Instantly share code, notes, and snippets.

View nexneo's full-sized avatar

Niket Patel nexneo

View GitHub Profile
sudo apt install nodejs npm
sudo apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
sudo npm install -g puppeteer-cli puppeteer --force

Keybase proof

I hereby claim:

  • I am nexneo on github.
  • I am nexneo (https://keybase.io/nexneo) on keybase.
  • I have a public key whose fingerprint is 00D2 69A3 DFD3 8331 8BD7 19ED 3214 2AC6 4BB9 5113

To claim this, I am signing this object:

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

@nexneo
nexneo / git-subtree.txt
Created December 15, 2015 13:32
Subtree Man Page
git-subtree(1)
==============
NAME
----
git-subtree - Merge subtrees together and split repository into subtrees
SYNOPSIS
--------
build_package_patched() {
# These three patches are included when RVM builds REE
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
patch -p1 < no_sslv2.diff
cd ..
@nexneo
nexneo / upgrade-notes.md
Created January 28, 2014 17:58
Locomotive upgrade notes.
@nexneo
nexneo / gobreak.sh
Last active December 16, 2015 19:19 — forked from icholy/gobreak.sh
#!/bin/sh
# Demo http://ascii.io/a/3019
# build with debug flags
go build -gcflags "-N -l" -o out
# find the debugger comments
awk '/\/\/debugger/ { print "break " FILENAME ":" FNR; }' `find $PWD -name "*.go" | xargs` > .breakpoints
@nexneo
nexneo / client.go
Last active December 16, 2015 15:49
Simulate async and sync message posting
package main
import (
"flag"
"fmt"
"io/ioutil"
// "math/rand"
"net/http"
"time"
)

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

Let me create some sample data, to show you why:
mid :: mday_no :: something
1 :: 37 :: apple
2 :: 37 :: banana
2 :: 38 :: canteloupe
Now consider the first query:
SELECT * FROM cb_main WHERE mid = '1' AND mday_no=(select max(mday_no))