Skip to content

Instantly share code, notes, and snippets.

View jah2488's full-sized avatar

Justin Herrick jah2488

View GitHub Profile
@jah2488
jah2488 / main.clj
Last active August 29, 2015 14:06 — forked from tylerjohnst/one.clj
(ns problem1.core)
(defn- real-numbers-below [x] (range 1 x))
(defn- multiple-of [x num] (zero? (mod x num))
(defn- multiple-of-three [x] (multiple-of x 3))
(defn- multiple-of-five [x] (multiple-of x 5))
(defn multiple-of-three-or-five [x]
(or (multiple-of-three x)
(multiple-of-five x)))
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- <meta />
Use meta nodes to set metadata for your application. The description is ignored
on most targets, but is useful for packaging like Chrome Apps or Opera Widgets.
For compatibility with Android and webOS, the package name must include at least
@jah2488
jah2488 / h_store_properties.rb
Last active December 15, 2015 20:59 — forked from hotgazpacho/h_store_properties.rb
I had to comment out the scope and attr_accessible as I did this sans rails, but it defines the methods correctly now on the instances of the Pump class.
module HStoreProperties
extend self
def boolean_h_store_fields_for(property_names)
property_names.each do |key|
attr_accessible key
scope "has_#{key}", lambda { |value| where('properties @> (? => ?)', key, value) }
define_method(key) do
properties && properties[key].to_bool
end
#!/usr/bin/env python
#===========================================================================================================================================
# ---- Productivity Calculator for Erepublik Beta and V1 ----
## Created by me
#
# Beta 0.3.5 -- October 25th 2008
#
##Notes
#
## Fatal Occurs during Windows EXE. Something wrong with the SHELVE Module
@jah2488
jah2488 / uninstall_homebrew.sh
Created February 26, 2012 23:59 — forked from mxcl/uninstall_homebrew.sh
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
set -e
cd `brew --prefix`
git ls-files -z | pbcopy
sudo rm -rf Cellar
bin/brew prune