Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PSPDFThreadSafeMutableDictionary.m | |
// | |
// Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# by Andreas Monitzer (@anlumo1) and Pepi Zawodsky (@MacLemon) | |
# | |
# This script published under WTF license | |
# http://en.wikipedia.org/wiki/WTFPL | |
# Improvements to this script are welcome though. | |
# Augments the Info.plist with a lot of nice stuff. | |
# It's suggested to call this script from a "run script" build phase, not copy the script's contents there. |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicRead", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket_name_here/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Makes JSON files out of CSV files. | |
""" | |
import argparse | |
import csv | |
import json | |
parser = argparse.ArgumentParser(description = "Turns a CSV file into JSON") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first you need to do a one-time setup step to create an OAuth token: | |
# do this to create an app with your OAUTH token | |
# | |
# curl -u github-user-name:github-password -H "Content-Type: application/json" -X POST -d '{"scopes":["gist"], "note": "gist backup"}' \ | |
# https://api.github.com/authorizations | |
# | |
# export GIST_OAUTH_TOKEN=xxxxx <<- token retrieved from the curl | |
# | |
curl -H "Authorization: token `echo $GIST_OAUTH_TOKEN`" -H "Content-Type: application/json" -X GET https://api.github.com/gists | \ | |
perl -ne 'if (m/.*raw.*(https.*)".*/){ print "$1\n"; }' | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// doesn't work with __block variables | |
#define keypath2(PATH) \ | |
do { \ | |
const char *_path = strchr(# PATH, '.') + 1; \ | |
\ | |
id _capturingBlock = ^{ \ | |
return PATH; \ | |
}; \ | |
\ | |
struct _literal { \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybing import Bing | |
from urllib2 import HTTPError | |
from BeautifulSoup import BeautifulSoup | |
from pybing import constants | |
import re | |
import mechanize | |
import simplejson | |
searchstring = "cows" # your search string here | |
searchcount = 40 |