Skip to content

Instantly share code, notes, and snippets.

View thinkclay's full-sized avatar

Clay Unicorn thinkclay

View GitHub Profile
import SpriteKit
class GameScene: SKScene, SKPhysicsContactDelegate
{
// Our main scene. Everything is added to this for the playable game
var moving: SKNode!
// Our running man! Defaults to a stand still position
var hero: SKSpriteNode! = SKSpriteNode(imageNamed: "runningman1")
import UIKit
import SwifteriOS
class TweetsViewController: UITableViewController {
var tweets : [JSONValue] = []
override func viewWillLayoutSubviews()
{
super.viewWillLayoutSubviews()
import UIKit
import Accounts
import Social
import SwifteriOS
class AuthViewController: UIViewController {
var swifter: Swifter
// Default to using the iOS account framework for handling twitter auth
@thinkclay
thinkclay / gist:10038490
Created April 7, 2014 19:44
Up and running with Ubuntu and Rails
apt-get update
apt-get upgrade
apt-get install gcc build-essential git-core mongodb
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
. ~/.bash_profile
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install -l
rbenv install 2.1.0
@thinkclay
thinkclay / aes.rb
Created March 23, 2014 13:49
Ruby: AES Example
require 'uri'
require 'net/http'
require 'net/https'
require 'base64'
input = "this is a test"
iv = "532b6195636c6127"
key = "532b6195636c61279a010000"
puts "Input: [" + input.bytes.join(" ") + "]"
@thinkclay
thinkclay / aes.go
Created March 23, 2014 13:48
GO: AES Example
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func main() {
input := []byte("this is a test")
@thinkclay
thinkclay / gist:8857122
Created February 7, 2014 03:49
Navicat Function to update Wordpress Post dates
BEGIN
SET @ID = 1;
WHILE @ID < 100 DO
UPDATE wp_posts SET comment_count = (SELECT COUNT('ID') FROM wp_comments WHERE comment_post_ID = @ID) WHERE ID = @ID;
SET @ID = @ID + 1;
END WHILE;
UPDATE wp_posts SET post_date = (SELECT FROM_UNIXTIME(post_time));
UPDATE wp_posts SET post_date_gmt = (SELECT FROM_UNIXTIME(post_time));
@thinkclay
thinkclay / ftp.php
Created August 3, 2013 00:53
A simple PHP FTP class to list and download files
<?php
class FTP {
/**
* Download() performs an automatic syncing of files and folders from a remote location
* preserving folder and file names and structure
*
* @param $local_dir: The directory to put the files, must be in app path and be writeable
* @param $remote_dir: The directory to start traversing from. Use "." for root dir
@thinkclay
thinkclay / gist:5433225
Created April 22, 2013 08:18
MongoDB M101 HW 3.1 in Ruby
require 'mongo'
require 'json'
include Mongo
@client = MongoClient.new('localhost', 27017)
@db = @client['school']
@students = @db['students']
@students.find().each { |student|
@thinkclay
thinkclay / create_screen.rb
Created April 12, 2013 13:06
RubyMotion example of keyboard handlers
Teacup::Stylesheet.new :create_screen do
# Input Fields
style :input_text_wrapper,
left: 24,
image: UIImage.imageNamed('ui-textfield-normal.png'),
userInteractionEnabled: true,
width: 249
style :input_text_type,