Skip to content

Instantly share code, notes, and snippets.

Seivan seivan

Block or report user

Report or block seivan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Jaybles / UIDeviceHardware.h
Created Oct 28, 2011
UIDeviceHardware - Determine iOS device being used
View UIDeviceHardware.h
// UIDeviceHardware.h
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
saetia / gist:1623487
Last active Mar 30, 2020
Clean Install – OS X 10.11 El Capitan
View gist:1623487

OS X Preferences

most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
Simbul / pre-commit
Created Feb 9, 2012
Git hook to prevent commits on a staging/production branch
View pre-commit
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["staging", "production"]
sw17ch / indented_parsec_example.lhs
Created Mar 16, 2012
A full example demonstrating the use of the indentation parser provided by the 'indents' package:
View indented_parsec_example.lhs
> module Main where
First, import all the needed modules.
> import Text.Parsec hiding (State)
> import Text.Parsec.Indent
> import Control.Monad.State
Next, define our new Parser type. This replaces the Identity monad
with the (State SourcePos) monad.
View TextFieldChanges.m
@synthesize firstName = _firstName;
@synthesize txtFirstName = _txtFirstName;
[RACAbleSelf(self.firstName) subscribeNext:^(id x) { [self firstNameChanged:x]; }];
[self rac_bind:RAC_KEYPATH_SELF(self.firstName) to:self.txtFirstName.rac_textSubscribable];
- (void) firstNameChanged:(id)firstName {
NSLog(@"changed: %@", firstName);
cobyism /
Last active Apr 2, 2020
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

bpo /
Last active Feb 27, 2020
Redis Lua examples
redis-cli EVAL "$(cat hello.lua)" 0
View assets.rake
# Stick this in lib/tasks/assets.rake or similar
# A bug was introduced in rails in 7f1a666d causing the whole application cache
# to be cleared everytime a precompile is run, but it is not neccesary and just
# slows down precompiling.
# Secondary consequences are the clearing of the whole cache, which if using
# the default file cache could cause an application level performance hit.
# This is already fixed in sprockets-rails for rails 4, but we patch here for
View BPGeometry.h
* BPGeometry.h
* Created by Jon Olson on 11/30/09.
* Copyright 2009 Ballistic Pigeon, LLC. All rights reserved.
#import <Foundation/Foundation.h>
johanneswuerbach / .travis.yml
Last active Mar 15, 2020
Deploy an iOS app to testflight using Travis CI
View .travis.yml
language: objective-c
- ./scripts/travis/
- ./scripts/travis/
- ./scripts/travis/
You can’t perform that action at this time.