Skip to content

Instantly share code, notes, and snippets.

set nocompatible " choose no compatibility with legacy vi
set number
set tabstop=2
set background=light
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
"" Whitespace
@mushky
mushky / gist:36376613e41e280bbf0e
Last active August 29, 2015 14:12
FizzBuzz Javascript
// Count to a hundred
// For every multiple of 3 PRINT "FIZZ"
// For every multiple of 5 PRINT "BUZZ"
// For every multiple of 15 PRINT "FIZZBUZZ"
console.log("Welcome to Fizz Buzz");
function fizzBuzz(number){
for (var i = 1; i <= number; i++) {
if (i%5==0 && i%3==0) // i%15
@mushky
mushky / gist:5dad6bdbbac3d58d1cb6
Created December 29, 2014 04:39
OpenCV Camera
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main() {
// Defining VideoCapture Objects
VideoCapture stream1(0); //0 is default, -1 = any camera, 1-99 range of cameras
@mushky
mushky / gist:7375423
Created November 8, 2013 18:32
jrpg battle system
# A simple text based JRPG Battle System. My biggest obstacle is getting the 2 counters to work properly.
# 1st counter tracks the HP of the Enemy and Hero class. 2nd counter tracks the Atk power of the Hero class.
# The Hero needs to defeat the Orc before either his HP or Atk power reaches 0.
# Whenever the Hero attacks he loses Atk power, and whenever the Orc attacks the Hero loses HP.
class Enemy
def initialize(hp)
@hp = hp #instance variables
end
class Car
@@WHEELS = 4
def initialize(args)
@color = args[:color]
@wheels = @@WHEELS
end
def drive
@status = :driving
end
def brake