Skip to content

Instantly share code, notes, and snippets.


Charles Feduke cfeduke

View GitHub Profile
View engineer.txt
Next Time Someone Claims To Be
An 'Engineer,' Give Them This Test.
Engineering is so trendy these days that everybody
wants to be one. The word "engineer" is greatly
overused. If there's somebody in your life who you
think is trying to pass as an engineer, give him this
test to discern the truth.
You walk into a room and notice that a picture is
hanging crooked. You...
cfeduke / patch-osx-bash-3.2
Last active Aug 29, 2015
Recompile and install OSX bash from Apple's source code archives with GNU patches applied (to prevent shellshock vulnerability)
View patch-osx-bash-3.2
# from with comments for 2nd patch
# original script author JonRow, 2nd patch script: rwebler
# recommend running these commands manually from Terminal, requires sudo for install
# you can:
# curl -L _this-url_ | sh
# if you are lazy
mkdir /tmp/bash-fix
cd cd /tmp/bash-fix
curl | tar zxf -
cd bash-92/bash-3.2
cfeduke / netsh
Created Nov 18, 2014
Generate command for forwarding Windows local port to OSX host for accessing OSX hosted web application as localhost
View netsh
#!/usr/bin/env bash
# Prints out the Windows netsh command necessary to port forward on localhost to another
# IP address. Especially useful when testing IE11 with APIs like Google Maps that only
# permit localhost connectivity but the actual server is on your local OSX host machine
# usage:
# netsh [interface] [port]
# e.g.,
cfeduke / ShardedJdbcRDD.scala
Last active Aug 29, 2015
JDBC RDD for Spark when data is pre-sharded across databases.
View ShardedJdbcRDD.scala
package org.apache.spark.rdd
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
cfeduke / bin_deploy
Last active Aug 29, 2015
Scala Spark with sbt-assembly example configuration
View bin_deploy
#!/usr/bin/env bash
set -o nounset
set -o errexit
readonly default_env="${0#*-}"
readonly ENV=${1:-$default_env}
readonly JAR_NAME="your-analytics.jar"
readonly UPLOAD_JAR=`dirname $0`/../target/scala-2.10/$JAR_NAME
cfeduke / aliases
Created Jan 28, 2015
View aliases
find-java-class () {
find . -name '*.jar' -type f -exec sh -c "jar -tf {} | grep -H --label {} \"$1\.class$\"" \;
cfeduke /
Created Nov 23, 2010
Execute git rm for each file removed from the file system after you've done it
# chmod +x
# add alias git-rm-after ~/ to ~/.bashrc
for i in `git status | grep deleted | awk '{print $3}'`; do git rm $i; done
cfeduke / irb load lib
Created Feb 10, 2011
Launch `irb` from your Ruby project's current directory and run...
View irb load lib
cfeduke / terminitor for node_smasher
Created Feb 28, 2011
sample terminitor project
View terminitor for node_smasher
before { run "cd ~/Projects/node_smasher" }
window :bounds => [0, 22, 865, 916], :settings => "Homebrew" do
run "mate ."
window :bounds => [866, 469, 1682, 915], :settings => "Homebrew" do
run "shotgun"
View recursive_node_tree.rb
# this handles package, node, asset, asset_binary, all recursively
get '/:klass/:id.:format' do |klass, id, format|
klass = klass.classify
options = eval("#{klass}::SERIALIZATION_OPTIONS")
DataFormatter::resolve(-> { eval("#{klass}.where(:id => #{id})")}, format, options)