Skip to content

Instantly share code, notes, and snippets.

Matt Weppler mweppler

Block or report user

Report or block mweppler

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
View modal_window.js
var modal = {
modalWindow : $('#modalWindow'),
windowMask : $('#mask'),
config: {
// maskEffect : 'fadeToggle',
// maskSpeed : 'fast',
// modalEffect : 'fadeToggle',
// modalSpeed : 'fast'
init: function(config) {
mweppler / remove_new_lines.rb
Created Jan 16, 2012
Remove newlines from files
View remove_new_lines.rb
out_file ="/Users/username/column_names-new.csv", "w")"/Users/username/column_names.csv", "r") do |in_file|
while line = in_file.gets
mweppler / compare_repo.rb
Last active Sep 28, 2015
Compares file hashes
View compare_repo.rb
#!/usr/bin/env ruby
require 'digest/md5'
require 'optparse'
class RepositoryFile
attr_accessor :obj_hash, :file_hash, :file_mtime, :file_name, :file_path
def initialize(obj_hash, file_hash, file_mtime, file_name, file_path)
@obj_hash = obj_hash
@file_hash = file_hash
mweppler / mersenne_twister.rb
Created Nov 6, 2011
Ported from objective-c implementation
View mersenne_twister.rb
@_MT =
@_index = 0
@maskUnity = 0xffffffff # 32 bits
@maskHighestBit = 0x80000000 # Most significant bit;
@maskLowerBits = 0x7fffffff # Last 32 bits
def initializeGenerator seed
# Set first array value to be the seed
@_MT[0] = seed
1.upto(623) do |i|
mweppler / batch_handbrake.rb
Created Oct 27, 2011
Batch encoder for handbrakecli.
View batch_handbrake.rb
#!/usr/bin/env ruby
require 'etc'
$currentUser = Etc.getlogin
def execute_encode_file
%x[sh ./batch_handbrakecli.command]
mweppler / gist:1310752
Created Oct 24, 2011
clip-it bookmarklet
View gist:1310752
javascript:(function(){function b(g){var m=document,k=m.createElement("script"),f=m.body,h=m.location,i="";try{if(!f){throw (0)}i=m.title;m.title="(Saving...) "+m.title;k.setAttribute("src",h.protocol+"//"+g+"&url="+encodeURIComponent(h.href));f.appendChild(k);m.title=i;return 0}catch(j){alert("The page has not loaded. Please try again in a moment.")}}function a(e,h){var d=document.createElement("script");d.src=e;var f=document.getElementsByTagName("head")[0];var g=false;d.onload=d.onreadystatechange=function(){if(!g&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){g=true;h();d.onload=d.onreadystatechange=null;f.removeChild(d)}};f.appendChild(d)}function c(d){var f=document.createElement("link");f.href=d;f.rel="stylesheet";f.type="text/css";var e=document.getElementsByTagName("head")[0];e.appendChild(f)}a("",function(){a("
mweppler /
Created Oct 20, 2011
Learning Binary Trees through recursive programming.
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
* Sample application output:
* **** Building Dictionary Start with Isabella ****
mweppler / inventory_fs.rb
Created Oct 4, 2011
Get an inventory of the file system...
View inventory_fs.rb
#!/usr/bin/env ruby
def compare_filesystem(previous, current)
previous_inventory =
current_inventory =
# puts "The following files have been added:"
# puts current_inventory - previous_inventory
# puts ""
mweppler / kitties_yay.js
Created Oct 4, 2011
Replace images on a page with kittens (boredom)...
View kitties_yay.js
if (jQuery) (function($){
jQuery('img').each(function() {
jQuery(this).attr('src', ''+jQuery(this).width()+'/'+jQuery(this).height());
mweppler / n_instruction_programs.rb
Created Oct 3, 2011
A programming language has 10 different instructions. How many five-instruction programs can be written in this language if no instruction is repeated? How many seven-instruction programs?
View n_instruction_programs.rb
def factorial n
f = n
for i in (n - 1).downto(1)
f *= i
i -= 1
return f
You can’t perform that action at this time.