View gist:4569362
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
murder = (howMany, bounce) -> | |
people = [0..howMany] # people from 0 to 40 | |
for i in people | |
people[i] = 1 | |
killed = Array() | |
count=0 | |
for i in [1..howMany] | |
whichOne = i*bounce - howMany*count | |
count++ if whichOne> (howMany-bounce) | |
if people[whichOne] is 1 |
View gist:4569549
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
part1 = 'abcdefghijklm ' | |
part2 = 'nopqrstuvwxyz.' | |
convert = (text) -> | |
output = "" | |
for i in [0...text.length] | |
index = part1.indexOf text.charAt(i) | |
if index isnt -1 then output += part2.charAt index else | |
index = part2.indexOf(text.charAt(i)) | |
output += part1.charAt index |
View gist:4576731
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
n=[] | |
n['M'] = 1000 | |
n['CM'] = 900 | |
n['D'] = 500 | |
n['CD'] = 400 | |
n['C'] = 100 | |
n['XC'] = 90 | |
n['L'] = 50 | |
n['XL'] = 40 | |
n['X'] = 10 |
View webkitGetUserMedia.js
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
navigator.webkitGetUserMedia({audio: true, video: false}, function(LocalMediaStream){ | |
audio = document.querySelector('video'); | |
if(typeof window.URL.createObjectURL(LocalMediaStream) != "undefined"){ | |
var file = window.URL.createObjectURL(LocalMediaStream); | |
audio.src = file; | |
audio.play(); | |
} | |
console.log(file); | |
console.log('>>'+LocalMediaStream.kind); // THIS WILL RETURN UNDEFINED | |
View gist:4727439
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
NullReferenceException: Object reference not set to an instance of an object | |
UnityEngine.GUI.DrawTextureWithTexCoords (Rect position, UnityEngine.Texture image, Rect texCoords, Boolean alphaBlend) (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/GUI.cs:215) | |
Character.Start () (at Assets/Character.cs:13) |
View gist:4727516
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
using UnityEngine; | |
using System.Collections; | |
public class Character : MonoBehaviour { | |
private float speed = 0.2F; | |
private Texture[] buffer = new Texture[2]; | |
private Texture image; | |
void Start () { |
View gist:5123160
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
Assets/Scripts/MenuManager.cs(25,17): | |
error CS0030: Cannot convert type | |
`System.Collections.Generic.KeyValuePair<int,System.Collections.Generic.Dictionary<int,UnityEngine.GameObject>>' | |
to | |
`System.Collections.Generic.KeyValuePair<int,UnityEngine.GameObject>' |
View gist:5201910
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
RewriteBase /~slackware/slackware.koding.com/website | |
Redirect /index.html http://slackware.koding.com/dock.php # <- this is not working | |
#DirectoryIndex dock.php index.html <- this works |
View gist:5217935
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
string foo[3] = {"a", "b", "c"}; | |
cout << &foo[0] << " minus " << &foo[1] << " equals " << int(&foo[0])-int(&foo[1]) << endl; | |
cout << *(&foo[0]-4) << endl; | |
cout << "Hello world!" << endl; |
View gist:5315500
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
function cd{ | |
cd $1 | |
pwd | |
} |
OlderNewer