Skip to content

Instantly share code, notes, and snippets.

View KyeRussell's full-sized avatar
🪴

Kye Russell KyeRussell

🪴
View GitHub Profile
@KyeRussell
KyeRussell / dubstep.py
Created July 18, 2011 11:53
Dubstep Algorithm
import audio
fh = read('wub.wav')
ao = audio.AudioPlayer()
while True:
ao.play_stream(read(fh), audio.format.waveform)
@KyeRussell
KyeRussell / bad.py
Created July 20, 2011 11:15
IfElse alternative
derp = raw_input()
if derp == 'a':
pass
elif derp == 'b':
pass
elif derp == 'c':
pass
else:
print "Invalid Choice"
@KyeRussell
KyeRussell / max.cpp
Created July 26, 2011 06:58
This is supposedly 4.5 hours of hardcore programming. I was not taught how to indent/style my code properly, I was not told how to comment, I was prohibited from using arrays, loops, or anything that we "weren't taught yet". Feels batman.
/* max.cpp
* Author: Kye Russell
* Date: 25/07/2011
*
* Take two numbers and return the maximum of the two.
*/
#include <iostream>
using namespace std;
@KyeRussell
KyeRussell / ex1.cpp
Created August 16, 2011 00:42
The end result of three hours of work. This class is /boring/.
/* ex1.cpp
* Author: Kye Russell
* Date: 15/08/2011
*
* - Read in temperatures for every day in Jan (31). Provide a prompt with a runnin
* day total.
* - Print the averge of all temperatures:
* - >30 degrees.
* - 20-30 degrees.
* - <20 degrees.
@KyeRussell
KyeRussell / sample.py
Created September 23, 2011 11:49
Sample Gist
print("Hello, World!")
@KyeRussell
KyeRussell / parse.py
Created September 26, 2011 05:02
Facebook API Example
import urllib2
import json
class FBParser(object):
"""Receive Facebook Open Graph API calls and return an object containing
the results"""
def call(self, call, api="https://graph.facebook.com/"):
"""Process Facebook API calls."""
# Grab the content.
@KyeRussell
KyeRussell / battleship.c
Created March 12, 2013 08:18
battleship.c, or how to suck at programming. I DID NOT WRITE THIS.
/* - Battle Ship - */
/* - By Simplicity - */
#include <stdio.h>
//#include <conio.h>
#include <stdlib.h>
void checkShips();
void quitGame();
void targeting();
@KyeRussell
KyeRussell / argument-passing-for-dummies.php
Created June 7, 2013 16:21
Argument passing for dummies, for somebody else. Gross oversimplifications.
<?php
/* Let's say we have this function, it just adds one to a
* number and returns the resulting value.
*
* It takes in a paramater, which we call $number.
*
* $number is a variable which only exists within the function, when we try
* to access $number from outside the function, it simply doesn't exist.
* $number simply refers to whatever we've passed to addOneToNumber. We use
@KyeRussell
KyeRussell / bubble.py
Created August 2, 2013 11:04
Python bubble sort
set = [1, 6, 2, 1, 21, 8, 34, 9, 9.1, 1, 12, 901, 0.31, -3]
searchable_set = len(set) - 1;
while searchable_set >= 0:
count = 0
while count <= searchable_set - 1:
if set[count] > set[count + 1]:
old = set[count + 1]
set[count + 1] = set[count]
# Basics
Port 22
Protocol 2
# Keys
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
AuthorizedKeysFile %h/.ssh/authorized_keys