Skip to content

Instantly share code, notes, and snippets.

View jfrazee's full-sized avatar

Joey jfrazee

View GitHub Profile
@alx
alx / git.rb
Created December 6, 2010 14:24
Jekyll plugin to add Git activity inside a list
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
@matatabi
matatabi / ajax_forms.html
Created February 22, 2011 08:55
Trigger rails 3 form submit without using the submit button
<script type="text/javascript">
function send(){
// check "send_now" and submit using ajax
// Assumes you're using jquery.rails.js
$("#send_now").val("true");
$("#f").trigger("submit");
};
</script>
<input type='hidden' id='send_now' name='send_now' />
@szegedi
szegedi / memoryPoolsHotSpot
Created December 13, 2011 23:03
names of MemoryManagerMXBean and MemoryPoolMXBean instances in HotSpot JVM
Table of names of MemoryManagerMXBean and MemoryPoolMXBean instances under
different GC algorithms in Oracle HotSpot VM. Memory managers list the pools
they manage in square brackets; memory pools show their maximum sizes for -Xmx200M setting.
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
SerialGC:
@mreid
mreid / INSTALL-VW-OSX.md
Created January 29, 2012 21:59
Install Vowpal Wabbit on Mac OS X Lion

The INSTALL instructions that come with Vowpal Wabbit appear not to work on Mac OS X Lion. Here's what I did to get it to compile. You will need the developer tools that come with the XCode installation.

The only dependency VW has is the boost C++ library. So first, download and install Boost

To install Boost, do the following:

$ cp ~/Downloads/boost_1_48_0.tar.bz2 ./
@leon
leon / play.conf
Created March 26, 2012 12:27
Upstart script for Play Framework 2.0
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/play.conf
#
# This could be the foundation for pushing play apps to the server using something like git-deploy
# By calling service play stop in the restart command and play-start in the restart command.
#
# Usage:
# start play
# stop play
# restart play
@hikoz
hikoz / Echo.scala
Created May 19, 2012 08:19
finagle failover
import java.net.InetSocketAddress
import org.jboss.netty.channel.ChannelPipelineFactory
import org.jboss.netty.channel.Channels
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder
import org.jboss.netty.handler.codec.frame.Delimiters
import org.jboss.netty.handler.codec.string.StringDecoder
import org.jboss.netty.handler.codec.string.StringEncoder
import org.jboss.netty.util.CharsetUtil
import com.twitter.finagle.builder.ClientBuilder
@eponvert
eponvert / WaffleAwesome.md
Created July 22, 2012 12:42
The Greatest Waffle Recipe on Earth or Anywhere Else

The Greatest Waffle Recipe on Earth or Anywhere Else

This recipe produces the most crispy and delicious waffles I've ever had. It has been adapted from a recipe in J. Bennett's (2001) excellent [Very Vegetarian][1], optimized for awesomeness and deliciousness. Candace and I were vegan when we originally developed this recipe, and so these waffles have no eggs or dairy.

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@taldanzig
taldanzig / osxvpnrouting.markdown
Created January 24, 2013 22:14
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@elventear
elventear / wget-alias.terminal
Created November 25, 2013 13:10 — forked from philiparthurmoore/wget-alias.terminal
Make a curl behave like wget with an alias
alias wget="curl -O --retry 999 --retry-max-time 0 -C -"
##
# Line should be placed at ~/.bash_profile
# Source: http://www.mymacosx.com/terminal/wget-replacement-macos.html
# Source: http://superuser.com/questions/142459/persistent-retrying-resuming-downloads-with-curl
##