Skip to content

Instantly share code, notes, and snippets.

View squarefrog's full-sized avatar
😍
❤️ Swift

Paul Williamson squarefrog

😍
❤️ Swift
  • Cambridgeshire, UK
View GitHub Profile
@squarefrog
squarefrog / UIDeviceHardware.h
Created October 18, 2012 16:28 — forked from Jaybles/UIDeviceHardware.h
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
+ (NSString *) platform;
@squarefrog
squarefrog / favicon
Created August 1, 2013 14:43
Modern Favicon
<!-- http://www.jonathantneal.com/blog/understand-the-favicon/ -->
<link rel="apple-touch-icon" href="path/to/touchicon.png">
<link rel="icon" href="path/to/favicon.png">
<!--[if IE]><link rel="shortcut icon" href="path/to/favicon.ico"><![endif]-->
<!-- or, set /favicon.ico for IE10 win -->
<meta name="msapplication-TileColor" content="#D83434">
<meta name="msapplication-TileImage" content="path/to/tileicon.png">
@squarefrog
squarefrog / .gitignore
Last active December 26, 2015 18:29 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

Pod::Spec.new do |s|
s.name = "UMengSocial"
s.version = "3.3.7.1"
s.summary = "UMeng's official Social SDK for iOS."
s.description = "UMeng Social SDK,You can easily share any content to Sina Weibo, Tencent Weibo, Renren, Qzone, Doubban, Wechat and so on using our unified APIs."
s.requires_arc = false
s.homepage = "http://dev.umeng.com/social/ios/share/quick-integration"
s.license = {
:type => "Copyright",
:text => <<-LICENSE
#!/usr/bin/env bash
# Loop through each colour and print to the Terminal
for i in {0..255} ; do
printf "\x1b[38;5;${i}mcolour${i}\n"
done
@squarefrog
squarefrog / mogenerator.sh
Last active August 29, 2015 14:02
Mogenerator Run Script
MODEL_DIR="ProjectName/Models"
MODEL_NAME="DataModel.xcdatamodeld"
PATH_TO_MODELD="${MODEL_DIR}/${MODEL_NAME}"
MACHINE_DIR="Machine"
HUMAN_DIR="Classes"
type mogenerator >/dev/null 2>&1 || {
echo >&2 "warning: mogenerator not found. You will need it when changing core data model";
exit 0;
}
@squarefrog
squarefrog / FolderViewController.m
Created July 21, 2014 08:15
upnpx batch fetch
//
// FolderViewController.m
// upnpxdemo
//
// Created by Bruno Keymolen on 02/07/11.
// Copyright 2011 Bruno Keymolen. All rights reserved.
//
#import "FolderViewController.h"
@squarefrog
squarefrog / FolderViewController.m
Created July 21, 2014 08:22
Background Parsing
//
// FolderViewController.m
// upnpxdemo
//
// Created by Bruno Keymolen on 02/07/11.
// Copyright 2011 Bruno Keymolen. All rights reserved.
//
#import "FolderViewController.h"
#!/bin/bash
# Install tcpdump on a Tomato firmware router
cd /tmp && wget http://www.dslreports.com/r0/download/1376456~0df06f4164393e0fdd2aa2eede183328/tcpdump.zip && unzip tcpdump.zip && chmod +x tcpdump && rm tcpdump.zip