Skip to content

Instantly share code, notes, and snippets.

View kognate's full-sized avatar

Joshua Smith kognate

  • Pittsburgh, PA
View GitHub Profile
(ns immutant.init
(:use irxcontrolcenter.core)
(:require [immutant.messaging :as messaging]
[immutant.web :as web]
[immutant.util :as util]
[ring.middleware.resource :as ring-resource])
)
;; This file will be loaded when the application is deployed to Immutant, and
@kognate
kognate / generate.sh
Created November 16, 2012 02:23
xslt for generating list of segues
#!/bin/bash
# run this file by chmod 755 generate.sh
# and then (in the same path as the xslt files)
# ./generate.sh someoutputfile PATHTOSTORYBOARD
#
xsltproc segue-h.xslt $2 > ${1}.h
xsltproc segue-m.xslt $2 > ${1}.m
@kognate
kognate / example.go
Created October 26, 2012 21:02
go function with returns
package main
import "fmt"
type AThing struct {
Public string
private int64
}
func (a *AThing) ireturn(onearg int64) (int64, error) {
@kognate
kognate / restartxcode.applescript
Created October 9, 2012 15:47
programatically restart xcode
tell application "Xcode"
quit
end tell
delay 10 -- Wait for Xcode to close
tell application "Xcode" to activate
@kognate
kognate / unix_instruments.sh
Created August 11, 2012 14:14 — forked from jonathanpenn/unix_instruments.sh
Make Instruments play nice with unix by returning > 0 status code if build fails
#!/usr/bin/env bash
#
# Copyright (c) 2012 Jonathan Penn (http://cocoamanifest.net)
# Gist: https://gist.github.com/1402258
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@kognate
kognate / prolog notes
Created December 30, 2011 15:49
prolog notes
use_module(library(http/http_client)).
use_module(library(http/http_open)).
use_module(library(xpath)).
http_open('http://www.codemash.org/rest/speakers', In, []),
load_xml_file(In,Out),
close(In).
http_open('http://www.codemash.org/rest/speakers', In, []),
(ns newsite.views.welcome
(:require [newsite.views.common :as common]
[noir.session :as session]
[noir.server :as server]
[noir.response :as response])
(:use [noir.core :only [defpage]]
[hiccup.core :only [html]]))
(defn- log [msg & vals]
(let [line (apply format msg vals)]
@kognate
kognate / gist:994423
Created May 27, 2011 00:40
tumbledry
require 'yaml'
class Tumbledry
attr_accessor :patterns
def initialize
File.open('repetative.txt', 'r') do |f|
@data = f.read()
end
self.patterns = {}
@numpat = 1
end
@kognate
kognate / conway.rb
Created February 24, 2011 02:10
I worked on this for another twenty minutes or so. found the bug. Run it in a terminal and you can see it run.
class Conway
attr_reader :displayrange
attr_accessor :board
# Any live cell with fewer than two live neighbours dies, as if caused by under-population.
# Any live cell with two or three live neighbours lives on to the next generation.
# Any live cell with more than three live neighbours dies, as if by overcrowding.
# Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
def initialize disprange = nil
@board = { 1 => { 2 => 1}, 2 => { 2 => 1}, 3 => { 2 => 1} }
@displayrange = disprange.nil? ? (0..10) : disprange
@kognate
kognate / basic.thrift
Created January 9, 2011 21:53
basic thrift file
enum PhoneType {
MOBILE,
HOME,
OFFICE
}
struct PhoneNumber {
1: PhoneType ptype,
2: string name,
3: string number