An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
XVFB=/usr/bin/Xvfb | |
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset" | |
PIDFILE=/var/run/xvfb.pid | |
case "$1" in | |
start) | |
echo -n "Starting virtual X frame buffer: Xvfb" | |
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS | |
echo "." | |
;; | |
stop) |
#pragma mark - | |
#pragma mark NSTableViewDataSource | |
- (void)tableView:(NSTableView *)tableView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forRowIndexes:(NSIndexSet *)rowIndexes | |
{ | |
// configure the drag image | |
// we are only dragging one item | |
NSTableCellView *cellView = [self.columnsTableView viewAtColumn:0 row:rowIndexes.firstIndex makeIfNecessary:NO]; | |
if (cellView) { | |
// CalculatorView.swift | |
// as seen in http://nshipster.com/ibinspectable-ibdesignable/ | |
// | |
// (c) 2015 Nate Cook, licensed under the MIT license | |
import UIKit | |
/// The alignment for drawing an String inside a bounding rectangle. | |
enum NCStringAlignment { | |
case LeftTop |
#!/bin/sh | |
sudo apt-get install -y moreutils git-buildpackage | |
>debian/changelog | |
prevtag=initial | |
pkgname=`cat debian/control | grep '^Package: ' | sed 's/^Package: //'` | |
git tag -l v* | sort -V | while read tag; do | |
(echo "$pkgname (${tag#v}) unstable; urgency=low\n"; git log --pretty=format:' * %s' $prevtag..$tag; git log --pretty='format:%n%n -- %aN <%aE> %aD%n%n' $tag^..$tag) | cat - debian/changelog | sponge debian/changelog | |
prevtag=$tag |
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
// You will also need to create a gmail filter to add the 'send-to-slack' label | |
// to any emails you want sent to slack | |
function sendEmailsToSlack() { | |
var label = GmailApp.getUserLabelByName('send-to-slack'); | |
var messages = []; | |
var threads = label.getThreads(); | |
for (var i = 0; i < threads.length; i++) { | |
messages = messages.concat(threads[i].getMessages()) |
#!/bin/bash | |
# interface speeds in BYTES per second | |
IFC="eth1" | |
WAN_DOWN=$((60 * 1024 * 128)) | |
WAN_UP=$((60 * 1024 * 128)) | |
# probably don't need to edit from here on |
These instructions compile a native OS X version of libmagic and the libmagic python binding, which use the system magic database, that live in your home directory, and which cannot be moved around, but which should always be discoverable by applications.
Assumes OS X with Xcode or Xcode command-line tools, not macports or homebrew
To install Xcode command-line tools in recent versions of OS X, open Terminal, type xcode-select --install
and click "Install"
Older versions of OS X may need to manually download disk images of older versions of Xcode and/or the Xcode command-line tools, as various certificates may have expired (e.g. 10.7.4 requires a manual install from the Xcode 4.6.2 command-line tools image)
Download Apple's latest modified file 5.04 (used in 10.7+) from http://opensource.apple.com/tarballs/file/file-47.tar.gz