Skip to content

Instantly share code, notes, and snippets.

View jasonleonhard's full-sized avatar

jasonleonhard jasonleonhard

View GitHub Profile
// ==UserScript==
// @name remove_yt_a
// @description remove_yt_a
// @match *://*.youtube.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant GM_addStyle
// @version 0.4
// @author un5t0ppab13
// ==/UserScript==
@jasonleonhard
jasonleonhard / gist:6d372a18acd0d98be047
Last active August 29, 2015 14:25
MONKEY PATCHING: Class and Method examples
# MONKEY PATCHING: Reopen and Add to Any Class in Ruby, including Gems and core Ruby.
# CLASS: naively sum elements in an Array
[1,2,3,4].sum
# undefined method `sum' for [1, 2, 3, 4]:Array (NoMethodError)
class Array
def sum
sum = 0
self.each do |e|
sum += e
end
#!/usr/bin/env bash
mkdir -p ~/.vimbundles
cd ~/.vimbundles
get_bundle() {
(
if [ -d "$2" ]; then
echo "Updating $1's $2"
cd "$2"
git pull --rebase
#!/usr/bin/env ruby
# reads in user provided parameter for function like ./readsFile2ReadIn.rb file2ReadIn
filename = ARGV.first
# when user forgets to provide parameter in function call like: ./readsFile2ReadIn4.rb
while !filename # if !filename # wont repeat and we want to repeat
print "file? \n"
file_again = $stdin.gets.chomp
print "Oh you want file: #{file_again} \n" # shows filename file2ReadIn which is not important...
#!/usr/bin/env ruby
# bst is O(log(n)) # the inverse is O(n^2))
# Almost, the inverse of 2^n is log2(n)
# define Node with pointers left and right and data key|value pair
p Node = Struct.new(:data, :left, :right)
puts
# define tree having root and current
class Tree
attr_accessor :root
lng lat
-122.79231919578592 45.619783717220
-122.79206328911766 45.621577190138
-122.79173767947158 45.623871402354
-122.79141980881165 45.625293820167
-122.79139212632786 45.625382855427
-122.79134413832539 45.625549974812
-122.79127366998294 45.625789735902
-122.79119623161218 45.626050556631
-122.79111555750978 45.626328074953
lng lat
-122.79231919578592 45.619783717220
-122.79206328911766 45.621577190138
-122.79173767947158 45.623871402354
-122.79141980881165 45.625293820167
-122.79139212632786 45.625382855427
-122.79134413832539 45.625549974812
-122.79127366998294 45.625789735902
-122.79119623161218 45.626050556631
-122.79111555750978 45.626328074953
@jasonleonhard
jasonleonhard / mapoverlaydata.json
Created June 17, 2018 21:40
temp place for json data to avoid too many lines being checked into git commit
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.