Skip to content

Instantly share code, notes, and snippets.


Ryan Seys ryanseys

Block or report user

Report or block ryanseys

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ryanseys /
Created Jan 17, 2013
Reverse a string in Python
def reverse(s):
return s[::-1]
ryanseys / fib_r.rb
Created Jan 20, 2013
Recursive Fibonacci solution
View fib_r.rb
def fib_r(n)
if(n <= 1)
return 1
return fib(n-1) + fib(n-2)
ryanseys / fib_i.rb
Created Jan 20, 2013
Iterative Fibonacci Solution
View fib_i.rb
def fib_i(n)
result = p1 = p2 = 1;
if(n > 1)
for i in 1..n
result = p1 + p2
p2 = p1
p1 = result
return result
ryanseys / print_s.c
Created Jan 20, 2013
Print string using no loops in C
View print_s.c
#include <stdio.h>
void print_s(const char * s) {
if(*s != 0) {
int main() {
ryanseys / print_s_r.c
Created Jan 20, 2013
Print a reverse string using no loops in C
View print_s_r.c
#include <stdio.h>
void print_s_r(const char * s) {
if(*s != 0) {
int main() {
ryanseys / play_mp3.rb
Created Apr 3, 2013
Play MP3 file in terminal using Ruby
View play_mp3.rb
pid = fork{ exec 'afplay', "song.mp3" } # on mac osx
ryanseys /
Created Apr 5, 2013
Queue Data Structure in Java
* "LinkEntry" class.
* This is an entry (or node) for a linked list containing an
* object of type E as the entry's data.
* @author Ryan Seys
* @param <E> the type of element which makes up the link entry.
public class LinkEntry<E> {
protected E element; // The entry's data.
ryanseys / FixLyricsWorkingWithSelection.scpt
Last active Dec 15, 2015
Remove excess strings from lyrics which are inserted and generated from the app "Get Lyrical".
View FixLyricsWorkingWithSelection.scpt
(* 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
if the trim_indicator is in {0, 2} then
repeat while this_text begins with the trim_chars
set this_text to characters (x + 1) thru -1 of this_text as string
ryanseys /
Created Apr 6, 2013
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 / fac_rec.js
Created Apr 21, 2013
Recursive Factorial in JavaScript
View fac_rec.js
function fac_rec(n) {
if(n <= 1) return 1;
else return n * fac_rec(n-1);
You can’t perform that action at this time.