Skip to content

Instantly share code, notes, and snippets.

View ryanseys's full-sized avatar
🌴

Ryan Seys ryanseys

🌴
View GitHub Profile
@ryanseys
ryanseys / .zshrc
Created May 28, 2013 16:24
Turn off zsh autocorrect
source $ZSH/oh-my-zsh.sh
unsetopt correct
@ryanseys
ryanseys / .git_config
Last active December 17, 2015 04:18
Sync master & gh-pages by adding these 2 lines in your .git/config file
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:user/repo.git
# add the following 2 lines so $ git push pushes to both master & gh-pages
push = +refs/heads/master:refs/heads/gh-pages
push = +refs/heads/master:refs/heads/master
@ryanseys
ryanseys / passer_rating.py
Created April 6, 2013 22:30
Calculates the Passer Rating (passer efficiency or pass efficiency) of a player given some variables. Use at own risk, old-as-fuck code here.
# This Python application will calculate the passer rating
# (passer efficiency or pass efficiency) given the five required variables.
#
# Variables to be used as values are defined below. Set to strings so input
# can be anything. Later the strings will be converted to numbers, given
# they pass a series of error checking tests.
COMP = "null"
ATT = "null"
YARDS = "null"
@ryanseys
ryanseys / coda.sh
Created April 25, 2013 00:08
Download all torrents from Coda.fm
#!/bin/bash
for (( c=1; c<=7087; c++ ))
do
wget http://coda.fm/albums/$c/torrent/download?file=$c.torrent
done
@ryanseys
ryanseys / fac_iter.js
Created April 21, 2013 16:38
Iterative Factorial in JavaScript
function fac_iter(n) {
var result = 1;
if(n > 1) {
while(n > 1) {
result *= n;
n--;
}
}
return result;
}
@ryanseys
ryanseys / fac_rec.js
Created April 21, 2013 16:38
Recursive Factorial in JavaScript
function fac_rec(n) {
if(n <= 1) return 1;
else return n * fac_rec(n-1);
}
@ryanseys
ryanseys / FixLyricsWorkingWithSelection.scpt
Last active December 15, 2015 20:09
Remove excess strings from lyrics which are inserted and generated from the app "Get Lyrical".
(* This is a script made by Ryan Seys to remove the excess strings from lyrics that are inserted and generated from the application "Get Lyrical". It properly removes the Title and Artist from the start of the Lyrics, and the text "branding" that Get Lyrical inserts to all the lyrics it fetches. Usage: Select the songs that you would like to clean in iTunes, then run the script.*)
on trim_line(this_text, trim_chars, trim_indicator)
-- 0 = beginning, 1 = end, 2 = both
set x to the length of the trim_chars
-- TRIM BEGINNING
if the trim_indicator is in {0, 2} then
repeat while this_text begins with the trim_chars
try
set this_text to characters (x + 1) thru -1 of this_text as string
@ryanseys
ryanseys / print_s_r.c
Created January 20, 2013 19:16
Print a reverse string using no loops in C
#include <stdio.h>
void print_s_r(const char * s) {
if(*s != 0) {
print_s_r(s+1);
putchar(*s);
}
}
int main() {
@ryanseys
ryanseys / print_s.c
Created January 20, 2013 19:10
Print string using no loops in C
#include <stdio.h>
void print_s(const char * s) {
if(*s != 0) {
putchar(*s);
print_s(s+1);
}
}
int main() {
@ryanseys
ryanseys / fib_i.rb
Created January 20, 2013 18:58
Iterative Fibonacci Solution
def fib_i(n)
result = p1 = p2 = 1;
if(n > 1)
for i in 1..n
result = p1 + p2
p2 = p1
p1 = result
end
end
return result