Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jonarcher on github.
  • I am jonarcher72 (https://keybase.io/jonarcher72) on keybase.
  • I have a public key ASBAIyD4GHtRQ1le8IuOOKx6dMwXZ0qVk2wHaQovTyuuugo

To claim this, I am signing this object:

@jonarcher
jonarcher / vter_munger.rb
Created April 7, 2015 02:18
Munge video timeout exceptions report files together
if ARGV.count < 2
puts "USAGE: ruby vter_munger.rb <output.file> <YYYYMMDD> <YYYYMMDD> ..."
puts "e.g. $ vter_munger foo.tsv 20150301 20150302 20150303"
puts "\nOutputs foo.tsv containing aggregated data from vter_20150301.tsv, vter_20150302.tsv and vter_20150303.tsv\n\n"
end
ARGV.each do |a|
begin
@output = a
next
@jonarcher
jonarcher / eww.xml
Created January 28, 2015 23:30
Eww. Just eww.
<bean id="contexts"
class="org.eclipse.jetty.server.handler.ContextHandlerCollection" />
<context:property-placeholder location="src/main/resources/ws.properties" />
<!-- Manually start server after setting parent context. (init-method="start") -->
<bean id="jettyServer" class="org.eclipse.jetty.server.Server"
destroy-method="stop">
<property name="threadPool">
<bean id="ThreadPool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
@jonarcher
jonarcher / SpringConfiguration.java
Created January 28, 2015 23:23
Configuring a servelt w/Jetty via Spring Java-based configuration
@Configuration
public class SpringConfiguration {
@Bean(initMethod = "start")
public Server server() {
Server server = new Server(1066);
server.setHandler(context());
return server;
}
@Bean
@jonarcher
jonarcher / iab_categories_json_to_csv.js
Created January 22, 2015 23:14
Given a borrowed JSON representation of IAB content categories (from: https://gist.github.com/crowdmatt/5040911) will spit 'em out as CSV
var categories = {
"IAB1": "Arts & Entertainment",
"IAB1-1": "Books & Literature",
"IAB1-2": "Celebrity Fan/Gossip",
"IAB1-3": "Fine Art",
"IAB1-4": "Humor",
"IAB1-5": "Movies",
"IAB1-6": "Music",
"IAB1-7": "Television",
@jonarcher
jonarcher / .inputrc
Created May 31, 2014 00:15
Configuration in .inputrc to improve command line editing
set editing-mode vi # hit escape and use vi commands to edit the text of the command line
"\e[1;6D": backward-word # use CTRL-SHIFT-LEFT_ARROW to jump back a word at a time
"\e[1;6C": forward-word # use CTRL-SHIFT-RIGHT_ARROW to jump foward a word at a time
"\C-b": backward-word # use CTRL-B to jump back a word at a time
"\C-f": forward-word # use CTRL-F to jump forward a word at a time
@jonarcher
jonarcher / .gitconfig
Last active August 29, 2015 14:02
A few git aliases and merge/diff confifiguration in .gitconfig
# colorful custom git log formats
[alias]
ls = log --pretty=format:'%C(yellow)%h %Cred%ar %Cblue[%an] %Creset%s'
ll = log --pretty=format:'%C(yellow)%h %Cred%ar %Cblue[%an] %Creset%s' --stat
co = checkout
#use intellij as merge/diff tool
[merge]
tool = intellij
[mergetool "intellij"]
@jonarcher
jonarcher / .bash_profile
Last active August 29, 2015 14:02
Useful stuff in my .bash_profile
# git command line completion (see: https://github.com/git/git/blob/master/contrib/completion/git-completion.bash)
. ~/.git-completion.bash
# git flow command line completion (see: https://github.com/bobthecow/git-flow-completion)
. ~/.git-flow-completion.bash
# git-prompt.sh to display current branch (see: https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh)
source ~/.git-prompt.sh
# psychedelic prompt w/git branch info
<bean class="com.lijit.blackbird.XMLFriendlyPropertySourcesPlaceholderConfigurer">
<property name="order" value="1"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="propertySources">
<list>
<bean class="org.springframework.core.io.support.ResourcePropertySource">
<constructor-arg value="file:./config/blackbird.properties" />
</bean>
<bean class="com.lijit.blackbird.AerospikePropertySource">
<constructor-arg value="something"/>
@jonarcher
jonarcher / gist:3405081
Created August 20, 2012 15:15
Spring Model Attribute
@ModelAttribute( "job" )
public Job getJobObject()
{
return new Job();
}