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
ryanseys / fizzbuzz.rkt
Last active Aug 29, 2015
Recursive FizzBuzz in Scheme
View fizzbuzz.rkt
#lang racket
(define (fizzbuzz n limit)
(cond
((eq? (modulo n 15) 0)
(printf "~a: FizzBuzz~n" n))
((eq? (modulo n 3) 0)
(printf "~a: Fizz~n" n))
((eq? (modulo n 5) 0)
(printf "~a: Buzz~n" n)))
@ryanseys
ryanseys / update.sh
Created Mar 15, 2014
Update/upgrade a bunch of stuff on my system
View update.sh
#!/usr/bin/env sh
gem update
brew update
brew upgrade
upgrade_oh_my_zsh
View style.css
.heart {
font-size: 200pt;
line-height: 0.9;
text-align: center;
color: red;
-webkit-animation:beat 0.6s infinite; /* Chrome, Safari, Opera */
-moz-animation:beat 0.6s infinite;
animation:beat 0.6s infinite;
}
@ryanseys
ryanseys / ramanujan.js
Created Jul 6, 2014
Finding Ramanujan numbers
View ramanujan.js
/**
* Find all possible sum of cubes for a particular number
* @param {Number} Number to find all sum of cube pairs
* @return {Array} Array of sum of cubes
*/
function findAllPossiblePairs(n) {
var doneFinding = false;
var i = 1;
var found = [];
var j = Math.floor(Math.pow(n, 1/3));
@ryanseys
ryanseys / increment.js
Last active Aug 29, 2015
Increment number represented in Array
View increment.js
/**
* Increment number represented in array
*
* E.g. Take [1, 2, 3] increment to [1, 2, 4]
* @param {[Number]} arr Array to increment
* @return {[Number]} Array of numbers
*/
function increment(arr) {
for(var i = arr.length - 1; i >= 0; i--) {
if(arr[i] === 9) {
@ryanseys
ryanseys / hello.js
Last active Aug 29, 2015
Simple JavaScript module
View hello.js
function hello() {
console.log('hello from a github gist');
}
module.exports = hello;
View format.js
/**
* Format a string with values from the provided object.
*
* @param {string} template - String with {} denoted keys. (See example)
* @param {object} args - Key/value pairs matching the holes in the template.
* @return {string}
*
* @example
* format('This is a {language} ({abbr}) codebase.', {
* language: 'JavaScript',
@ryanseys
ryanseys / assign1.cpp
Last active Aug 29, 2015
Render triangles in OpenGL
View assign1.cpp
/**
* Assignment 1 - COMP 4002
* Part 1: Task 1 and 2
*
* Single and recursive triangles - no shaders
*
* Ryan Seys - 100817604
*
* Compile on Mac with:
* $ g++ assign1.cpp -o assign -framework OpenGL -framework GLUT && ./assign
View assign1part2.cpp
/**
* Assignment 1 - COMP 4002
*
* Includes:
* Part II: Task 3 and Task 4
* Part III: Colouring bonus - recursive triangle is coloured.
* Part IV: Displacement parameter “dispX”
*
* Single and recursive triangles - with shaders
*
@ryanseys
ryanseys / deploy.sh
Created Sep 27, 2014
Prepare image for deployment using Dokku
View deploy.sh
#!/bin/sh
set -e
# Create image for deployment with Dokku
USERNAME=user # this is the user you will use to ssh into the server with
DOMAIN=example.com
echo 'Updating server...'
You can’t perform that action at this time.