Skip to content

Instantly share code, notes, and snippets.

View ninjapanzer's full-sized avatar
🌋
Back to the FOSS

Paul Scarrone ninjapanzer

🌋
Back to the FOSS
View GitHub Profile
@ninjapanzer
ninjapanzer / impact_testing_overview.js
Last active August 29, 2015 13:56
Impact Testing
describe('Plugins/SkinManager', function() {
it('init', function() {
var global={};
global.sm;
runs(function(){
testModule({ for:"skin-manager", requires:["plugins.skin-manager"] }).defines(function() {
@ninjapanzer
ninjapanzer / gist:6550440
Created September 13, 2013 13:06
Rortated headers 45degrees
&.rotated{
tr{
& th:first-child div{
width: 100%;
}
background: transparent;
height: 80px;
&.ie{
background: lighten($body_text_color, 60%);
height: 20px;
@ninjapanzer
ninjapanzer / ruby_warrior_respond_to.rb
Created August 12, 2013 13:07
respond_to? ruby warrior rewrite
class Player
def init(warrior)
@warrior = warrior
@low_side ||= 10
@current_direction ||= :forward
@backsteps ||= 0
@skip ||= false
@turn_count ||= 0
@health ||= 20
@ninjapanzer
ninjapanzer / gist:6205619
Last active December 20, 2015 22:29
Ruby Warrior Level 9 Works for levels 8 and 9 - Does a pass to see if the warrior is between enemies an then goes to work
class Player
def init(warrior)
@warrior = warrior
@low_side ||= 10
@current_direction ||= :forward
@backsteps ||= 0
@skip ||= false
@turn_count ||= 0
@ninjapanzer
ninjapanzer / gist:6023103
Created July 17, 2013 18:26
Nice console snipet
if (typeof(console) !== 'undefined') {
if ('debug' in console) {
console.debug('Hey, you have your debugger enabled :)');
} else {
console.log('Hey, you have your IE debugger enabled :-/');
}
} else {
var Console = Class.create();
Console.prototype = {
initialize: function() {},
@ninjapanzer
ninjapanzer / gist:5693920
Last active December 18, 2015 00:08
MIT will make me broke and I am not even a student
Algorithms Unlocked
Thomas H. Cormen
ISBN: 9780262518802
Machine Learning
Kevin P. Murphy
ISBN: 9780262018029
Introduction to Machine Learning, second edition
Ethem Alpaydin
@ninjapanzer
ninjapanzer / frame.html
Last active December 14, 2015 12:18
Some cross browser iframe testing for responsive iframes. All vanilla JS and some simple styles
FRAME
@ninjapanzer
ninjapanzer / lexer.ex
Created February 28, 2013 20:04 — forked from swarley/lexer.ex
defmodule Lexer do
defmodule PIR do
require LexChar
defmacrop line(opts) do
quote do: elem(unquote(opts),1)
end
defmacrop file(opts) do
quote do: elem(unquote(opts),2)
end
@ninjapanzer
ninjapanzer / WordCounters
Created February 28, 2013 20:04
A toy that sums up a string
class WordCounters
def self.count_up_word word
count = 0
word.each_char do |l|
count = l.ord + count
end
count
end
@ninjapanzer
ninjapanzer / mergsort_coursera_algo
Last active December 11, 2015 23:18
Merge Sort with so Debugging Statements I pulled this from the web somewhere but I don't remember the URL and made some modifications
a = [5,4,1,8,7,2,6,3,5,2,3,45,1,1,3,4,99,2,3]
puts a.size
@recurse = 0
def mergesort(list)
return list if list.size <= 1
mid = list.size / 2
left = list[0, mid]
right = list[mid, list.size]
@recurse = @recurse + 1