Skip to content

Instantly share code, notes, and snippets.

View iwaffles's full-sized avatar

Matt Gardner iwaffles

View GitHub Profile
@iwaffles
iwaffles / linux-mem-type.sh
Created October 2, 2015 16:28
Find the type of memory installed on the Linux machine
sudo lshw | sed -n '/*-memory/,/*-pci/p' | head -n -1

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Using [Docker][docker] on OSX

A. Basic setup: run [IO.js][iojs] REPL on docker container

1. Prepare docker related programs with [homebrew][homebrew] and [homebrew-cask][cask]

("brew" and "cask" is installed on OSX)

brew cask install virtualbox

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Record a screencast with QuickTime Player

  1. Connect an iOS defice with a cable
  2. In QuickTime Player: Option-Cmd-N (New Movie Recording) -> Select your device from the recording menu:

http://cl.ly/image/1w0y3Y0H2g2X/record.png

Install gifify

@iwaffles
iwaffles / QueryParams
Created July 3, 2014 22:54
Query Params with AFNetworking
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *params = @{
@"name": name,
@"another_value": something_else
};
NSString *urlString = @"http://postSomethingHere.com/";
[manager POST:urlString
parameters:params
constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
} success:^(AFHTTPRequestOperation *operation, id responseObject) {
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@iwaffles
iwaffles / amazon-affiliates-bookmarklet.js
Last active December 12, 2015 08:49
Amazon Affiliates Bookmarklet
(function(){
var aff = 'igotablog-20';
if (!document.getElementById('ASIN')) {
alert('Can\'t find the product ID');
return;
}
var asin = document.getElementById('ASIN').value;
prompt(
'Here is the link:',
'http://www.amzn.com/' + asin + '/?tag=' + aff);
@iwaffles
iwaffles / install.md
Last active December 11, 2015 21:59 — forked from seamusjr/install.md

Setup new Mac with OSX Lion from scratch.

These commands are good as of 2012-03-18.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Note: Make sure you install the XCode Command Line Tools after XCode is done installing. To do this go to Xcodes -> Preferences -> Downloads -> Command Line Tools -> Install. If you don't you might not be able to install brew packages (i.e. brew install wget will fail).*

$ sudo adduser --system --no-create-home --disabled-login --disabled-password --group juggernaut
$ sudo mv ~/juggernaut2-for-init.d-startup.sh /etc/init.d/juggernaut
$ sudo chmod +x /etc/init.d/juggernaut
$ sudo update-rc.d -f juggernaut defaults