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 parseInputs(data) { | |
var ret = {}; | |
retloop: | |
for (var input in data) { | |
var val = data[input]; | |
var parts = input.split('['); | |
var last = ret; | |
for (var i in parts) { |
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
find . -type f -print0 | xargs -0 chmod 644 | |
find . -type d -print0 | xargs -0 chmod 755 |
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
{ | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"ensure_newline_at_eof_on_save": true, | |
"font_face": "Source Code Pro",//"Menlo", | |
"font_size": 12, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"scroll_past_end": true, | |
"theme": "Soda Dark.sublime-theme", |
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
// | |
// main.cpp | |
// Test libCEC | |
// | |
// Created by Ryan Sullivan on 10/26/15. | |
// Copyright © 2015 Ryan Sullivan. All rights reserved. | |
// | |
#import <iostream> | |
#import <cec.h> |
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
#!/usr/bin/env bash | |
brew tap | while read tap; | |
do | |
echo "brew tap $tap" | |
done | |
brew list | while read formula; | |
do | |
options=$(brew info --json=v1 $formula | jq '.[0] .installed | sort_by(.version) [0] .used_options | join(" ")' -r) |
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
# Get the amount of vectors we need to sum | |
Input "SUM HOW MANY? ", A | |
# Clear the previous lists | |
ClrList lVSUA | |
ClrList lVSUB | |
ClrList lVSUX | |
ClrList lVSUY | |
# Zero-out each list with A items |
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
if ARGV.count != 1 | |
puts "Usage: [command ...] <file>" | |
exit | |
end | |
f = File.new(ARGV[0], 'r') | |
hash = Hash.new | |
f.each_byte do |byte| |
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
prev = [] | |
start = 5 | |
num = start | |
lastPrime = (0,0) | |
ctr = 2 # 5 is the 3rd prime | |
while ctr < 50000: | |
isPrime = not any(num % n == 0 for n in prev) | |
if isPrime: | |
ctr += 1 |
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
from math import floor | |
def pp(n): | |
return (6*(floor(n/2)+1)) + (-1 if n % 2 == 0 else 1) | |
for i in xrange(0, 50): | |
print "%d\t\t%d" % (i, pp(i)) |
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
def nBang(n): | |
mul = 1 | |
for i in xrange(1,n+1): | |
mul *= i | |
return mul | |
def R(n): | |
bang = str(nBang(n)) | |
sum = 0 | |
for i in xrange(0, len(bang)): |