Skip to content

Instantly share code, notes, and snippets.

View teameh's full-sized avatar

Teameh teameh

View GitHub Profile
@lrhoek
lrhoek / sync.sh
Created September 21, 2015 00:17
Automatically rsync a directory with fswatch
#!/bin/bash
fswatch -0 -o $1 | xargs -0 -I {} rsync -avz --delete $1 $2
@Starefossen
Starefossen / remoteDataTableView.swift
Last active January 16, 2023 09:50
Remote JSON Data to tableView in iOS 8.0 (Swift)
import UIKit
import Foundation
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely()
class RemoteAPI {
func getData(completionHandler: ((NSArray!, NSError!) -> Void)!) -> Void {
let url: NSURL = NSURL(string: "http://itunes.apple.com/search?term=Turistforeningen&media=software")
let ses = NSURLSession.sharedSession()
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@andrewsardone
andrewsardone / gist:3740504
Created September 17, 2012 23:58
CGRectDivide

CGRectDivide is handy for slicing up a rectangle.

Example of getting a slice and the remaining area of a rectange.

CGRect rect = CGRectMake(0, 0, 240, 150);
  
CGRect remainder, slice;
    
CGRectDivide(rect, &slice, &remainder, 120, CGRectMinYEdge);