This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-git2.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
; -- 1.1 -- | |
; (define a 3) | |
; (define b (+ a 1)) | |
; (+ a b (* a b)) | |
; (if (and (> b a) (< b (* a b))) | |
; b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off " required for vundle | |
set rtp+=~/.vim/bundle/Vundle.vim | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
call vundle#begin() | |
execute pathogen#infect() | |
Plugin 'gmarik/Vundle.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// operator overloading | |
func + (left: [Double], right: [Double]) -> [Double] { | |
var sum: [Double] = [] | |
for (n, m) in zip(left, right) { | |
sum.append(n + m) | |
} | |
return sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
// ARRAYS | |
// many ways to mak arrays | |
var array1: Array<String> | |
var array2: [String] | |
var array3 = ["apple", "pear"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func updateSongInformationForListener(currentTrack: Track, channelID: String) { | |
let song = currentTrack.dictionaryValue() | |
client.publish(song, toChannel: channelID, compressed: true) { (status) -> Void in | |
if status.error { | |
print("*** pubnub publish error: \(status.category), \(status.error.description)") | |
print(status.debugDescription) | |
// Request can be resent using: status.retry() | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AudioToolbox | |
func vibrateForever() { | |
let k_PeakSoundID: UInt32 = 1519 | |
while true { | |
AudioServicesPlaySystemSound(k_PeakSoundID) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fragment Shader Modifier | |
// Implicit struct to use: | |
/* | |
struct SCNShaderOutput { | |
vec4 color; | |
} _output; | |
*/ | |
varying vec3 varyingNormal; |