Skip to content

Instantly share code, notes, and snippets.

View iwaffles's full-sized avatar
🎙️
https://noob.show

Matt Gardner iwaffles

🎙️
https://noob.show
View GitHub Profile
@iwaffles
iwaffles / .zshrc
Created January 8, 2013 22:18
Resume in terminal when using zsh instead of the default (bash).
# I found this here: http://superuser.com/questions/313650/resume-zsh-terminal-os-x-lion/328148
# Tell the terminal about the working directory whenever it changes.
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL, including
# the host name to disambiguate local vs. remote paths.
# Percent-encode the pathname.
local URL_PATH=''
@iwaffles
iwaffles / waitForJquery.js
Created January 9, 2013 07:51
Wait for jQuery to be loaded
var checker = 0;
function jqueryLoaded() {
clearInterval(checker);
console.log("jquery is loaded!");
}
function waitForJquery() {
if (window.jQuery) {
jqueryLoaded();
@iwaffles
iwaffles / diggdigg-style.css
Created January 15, 2013 03:46
Change the background of Digg Digg from White to Black.
#dd_ajax_float {
text-align:center;
border:1px solid #bbb;
min-width:55px;
width:auto;
-webkit-border-top-right-radius:5px;
-webkit-border-bottom-right-radius:5px;
-webkit-border-bottom-left-radius:5px;
-webkit-border-top-left-radius:5px;
-moz-border-radius-topright:5px;
## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
# Some "heroku apps" lines have === formatting for grouping. They're not apps.
next if app[0..2] == "==="
$ 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
@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).*

@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);
# 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 / 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) {

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