Skip to content

Instantly share code, notes, and snippets.

View richy486's full-sized avatar
🐶
Experimenting

Richard Adem richy486

🐶
Experimenting
View GitHub Profile
@richy486
richy486 / vTag.sh
Created October 4, 2011 02:59
updates your Xcode 4 info.plist with the current git tag as version and commit number
# updates your info.plist with the current git tag as version and commit number
# in that tag as build numer, then ammends the changed file to git
# run this after your normal commit but before you push
#
# this to be placed in the same directory as the xcode project file
# info.plist to be in the path [folder with projectfile]/[project name]/[project name]-Info.plist
# git tags to be in the form of v[number]
#
# Don't forget to do chmod +x ~/whatever/vTag.sh
#
@richy486
richy486 / RectHelper.h
Created November 24, 2011 00:13
Some Macros for changing rects on one line
//
// RectHelper.h
//
// Created by Richard Adem on 24/11/11.
// Copyright (c) 2011 Richard Adem. All rights reserved.
//
// richy486@gmail.com
// twitter.com/richy486
//
@richy486
richy486 / .gitignore
Created December 6, 2011 02:05
ignore xcode and osx files for git
# System
.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.moved-aside
project.xcworkspace/
@richy486
richy486 / .bash_profile
Last active November 9, 2020 10:15
bash profile
# BASH PROFILE!!
# reload without closing terminal window with $ source ~/.bash_profile
# Alias'
export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd"
alias ls="ls -G -a -l"
alias glog="git log --graph --date-order --date=relative --color=always --oneline"
alias gstat="git status -s"
alias mm?="git branch --merged master"
alias cdd="rm -rf ~/Library/Developer/Xcode/DerivedData"
@richy486
richy486 / gist:3133622
Created July 18, 2012 02:05
cellForRowAtIndexPath
- (UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"cellIdentifier";
// Normal cell
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
}
[btnShare setTranslatesAutoresizingMaskIntoConstraints:NO];
NSDictionary *metrics = @{@"height":@44.0
, @"width":@44.0
, @"edgeSpace":@10.0};
NSDictionary *views = NSDictionaryOfVariableBindings(button);
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[button(width)]-edgeSpace-|" options:0 metrics:metrics views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-edgeSpace-[button(height)]" options:0 metrics:metrics views:views]];
var express = require('express');
var app = express();
app.get('/stuff', function(req, res) {
res.send(
{
"options": {
"something": "1234"
},
@richy486
richy486 / Default (OSX).sublime-keymap
Last active April 8, 2021 10:53
Sublime settings
[
{ "keys": [ "ctrl+alt+m" ], "command": "un_pretty_json" },
{ "keys": [ "alt+m" ], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} },
{ "keys": [ "super+shift+j" ], "command": "reveal_in_side_bar" },
{ "keys": [ "super+ctrl+left" ], "command": "prev_view" },
{ "keys": [ "super+ctrl+right" ], "command": "next_view" },
{ "keys": [ "super+0"], "command": "reset_font_size" },
]
@richy486
richy486 / button.py
Created September 3, 2014 05:30
Tweeting raspberry pi button
#!/usr/bin/env python
import sys
from twython import Twython
import RPi.GPIO as GPIO
import time
CONSUMER_KEY = '---- API key here ----'
CONSUMER_SECRET = '---- API secret here ----'
ACCESS_KEY = '---- Access token here ----'
@richy486
richy486 / button2.py
Last active September 21, 2015 08:42
Button with sound and auto tweet counter
#!/usr/bin/env python
import sys
print 'starting...'
from twython import Twython
from twython import TwythonError
import RPi.GPIO as GPIO
import time