Skip to content

Instantly share code, notes, and snippets.

View kognate's full-sized avatar

Joshua Smith kognate

  • Pittsburgh, PA
View GitHub Profile
@kognate
kognate / sentiment.js
Created October 20, 2016 13:36
example of how to use sentiment and pass language
'use strict';
var AlchemyLanguageV1 = require('watson-developer-cloud/alchemy-language/v1');
var alchemy_language = new AlchemyLanguageV1({
api_key: process.env['ALCHEMY_LANGUAGE_API_KEY']
});
var parameters = {
text: 'I love programming',
import Cocoa
import GameplayKit
let gpkrand = GKMersenneTwisterRandomSource()
enum Suite: Int {
case Hearts = 1
case Spades = 2
case Clubs = 3
case Diamonds = 4
let flatten = function(list) {
return list.reduce(function(acc, item) {
let res = Array.isArray(item) ? flatten(item) : item
return acc.concat(res)
},[])
}
@kognate
kognate / conways.swift
Created November 3, 2015 04:21
The Accelerate Framework is awesome
//
// main.swift
// conways
//
// Created by Josh Smith on 11/2/15.
// Copyright © 2015 Josh Smith. All rights reserved.
//
import Foundation
import Cocoa
@kognate
kognate / spritekit
Created July 11, 2015 19:14
sprite kit ship turtle
import UIKit
import SpriteKit
import XCPlayground
let view = SKView(frame: CGRectMake(0, 0, 300, 300))
let scene = SKScene(size: view.frame.size)
view.presentScene(scene)
let ship = SKSpriteNode(imageNamed: "Spaceship.png")
ship.size = CGSizeMake(25, 25)
scene.addChild(ship)
@kognate
kognate / keybase.md
Created September 23, 2014 19:58
keybase.md

Keybase proof

I hereby claim:

  • I am kognate on github.
  • I am kognate (https://keybase.io/kognate) on keybase.
  • I have a public key whose fingerprint is 8F23 0F1F BCD6 55DC 7553 893A F300 4D1A D086 DDE3

To claim this, I am signing this object:

@kognate
kognate / keybase
Created September 23, 2014 19:57
keybase
```
And finally, I am proving ownership of the github account by posting this as a gist.
### My publicly-auditable identity:
https://keybase.io/kognate
### From the command line:
@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
@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 / 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;