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 sumAll(arr) { | |
var min = Math.min.apply(null, arr), | |
max = Math.max.apply(null, arr), | |
newArr = [], | |
i; | |
for (i = min; i <= max; i++) { | |
newArr.push(i); | |
} | |
return newArr.reduce(function (a,b) { | |
return a+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
function rot13(str) { | |
return str.split('').map(shiftLetters).join(''); | |
function shiftLetters(letter) { | |
var charCode = letter.charCodeAt(0); | |
var shift13 = charCode + 13; | |
var over90 = 64 + (shift13 - 90); | |
return String.fromCharCode(charCode <= 64 ? charCode : shift13 > 90 ? over90: shift13); | |
} |
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 rot13(str) { | |
var map = Array.prototype.map; | |
var a = map.call(str, function(x) { | |
return x.charCodeAt(0); | |
}); | |
var b = a.map(function(y) { | |
if (y > 64) { | |
var z = y + 13; | |
if (z > 90) { | |
return z - 26; |
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
##! /bin/bash | |
# modified script for streaming on Linux via ffmpeg. | |
# Original see here: https://gist.github.com/oseparovic/2db2aaa737cd37e7c068 | |
# see http://ubuntuguide.org/wiki/Screencasts for full documentation | |
# see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/ | |
# for instructions on how to use this gist | |
if [ ! -f ~/.twitch_key ]; then | |
echo "Error: Could not find file: ~/.twitch_key" |
NewerOlder