Skip to content

Instantly share code, notes, and snippets.

View kognate's full-sized avatar

Joshua Smith kognate

  • Pittsburgh, PA
View GitHub Profile
(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 / 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, []),
@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 / 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 / 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 / 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
(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 / RefactorTest.h
Last active December 21, 2015 21:09
RCW refactor coding sample
@interface RefactorTest : NSObject
@property (strong, nonatomic) NSMutableArray *arrayPayloadValue;
- (id) initWithArray:(NSArray *) thearray;
// this should return the sum of the array values
- (NSNumber *) sum;
// this should return the average of the array values
- (NSNumber *) average;
@kognate
kognate / test.m
Created September 27, 2013 03:29
Great bug. I think?
#import <XCTest/XCTest.h>
@interface RadarReport_Tests : XCTestCase
@property (strong) NSMapTable *mt;
@end
@implementation RadarReport_Tests
- (void)setUp
{
@kognate
kognate / bird.swift
Created August 7, 2014 16:02
bird.swift
//
// GameScene.swift
// FlappyBird
//
// Created by Josh Smith on 8/7/14.
// Copyright (c) 2014 Josh Smith. All rights reserved.
//
import SpriteKit