Skip to content

Instantly share code, notes, and snippets.

View lukeholder's full-sized avatar
👾

Luke Holder lukeholder

👾
View GitHub Profile
@lukeholder
lukeholder / identity.less
Created March 27, 2012 20:50
identity.less
// Hides the options based on authorisation. If not authenticated then the class
// will be .isNotAuthenticatedtrue, if authenticated then the class would be .isAuthenticatedtrue
.isNotAuthenticated, .isAuthenticated
{
display: none;
}
// Default login is email based, so hide the .nameBased features -->
@lukeholder
lukeholder / peepcode.rb
Created April 9, 2012 22:33 — forked from gertig/peepcode.rb
A script to download all Peepcode screencasts with ruby & wget (supports resume)
require 'mechanize'
@username = 'username@email'
@password = 'password'
@download_path = File.expand_path 'downloads'
@wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt'
unless File.directory? @download_path
puts "@{download_path} doesn't exist!"
exit
@lukeholder
lukeholder / error.txt
Created August 27, 2012 06:29
jruby error after jruby -v
getting the error below after fresh install jruby on windows 7
C:\Users\lholder>jruby -v
jruby 1.7.0.preview2 (1.9.3p203) 2012-08-07 4a6bb0a on Java HotSpot(TM) 64-Bit S
erver VM 1.7.0_05-b05 [Windows 7-amd64]
2012-08-27T14:24:18.995+08:00: Ruby: org.objectweb.asm.ClassReader
java.lang.ClassNotFoundException: org.objectweb.asm.ClassReader
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
@lukeholder
lukeholder / redis install
Created September 27, 2012 01:57 — forked from antond/redis install
redis install on CentOS
1.CentOS 6.3
#yum install make gcc
#cd /opt
$wget http://redis.googlecode.com/files/redis-2.x.xx.tar.gz
$tar zxf redis-2.x.xx.tar.gz
$cd redis-2.x.xx
$make
$make install
//////
@lukeholder
lukeholder / firstdomainfix.js
Created November 1, 2012 09:34
First Domain Image Fix
jQuery('#feature-wrapper .feature img').attr('src',jQuery('#feature-wrapper .feature img').attr('src')+'?r='+Math.floor(Math.random()*1000000))
@lukeholder
lukeholder / SageTimberline-JobCostTotalsByTransactionType.sql
Last active October 12, 2015 10:48
Sage Timberline - Job Cost Totals by transaction type
WITH JobTransactionsSumTypes AS
(
SELECT
[Job],
[Cost_Code],
SUM(CASE WHEN [Transaction_Type] = 'AP cost' THEN [Amount] ELSE NULL END) AS APcostAmountSum,
SUM(CASE WHEN [Transaction_Type] = 'Approved est changes' THEN [Amount] ELSE NULL END) AS ApprovedEstChangesAmountSum,
SUM(CASE WHEN [Transaction_Type] = 'Aprvd cmmtt cst chng' THEN [Amount] ELSE NULL END) AS AprvdCmmttCstChngAmountSum,
SUM(CASE WHEN [Transaction_Type] = 'Aprvd schdl val chn' THEN [Amount] ELSE NULL END) AS AprvdSchdlValChnAmountSum,
SUM(CASE WHEN [Transaction_Type] = 'Cash receipt' THEN [Amount] ELSE NULL END) AS CashReceiptAmountSum,
@lukeholder
lukeholder / all.rb
Created November 9, 2012 08:00
all files
def self.all
all_files = []
files = Dir.glob("#{INVOICES_PATH}/*")
files.sort.each do |file|
id = Digest::MD5.hexdigest(File.open(file, "rb") { |f| f.read })
file_obj = {
:id => id,
:name => File.basename(file),
:stamped => Stamp.exists?(:file_hash => id),
:dup => false
@lukeholder
lukeholder / error.txt
Created November 14, 2012 03:07
jruby
NameError: cannot load Java class java.io.*
for_name at org/jruby/javasupport/JavaClass.java:1206
@lukeholder
lukeholder / statetoggle.coffee
Created November 15, 2012 07:09
toggle needs state
changeTagState = (newstate, elem) ->
$item = $(elem).parent()
$icon = $item.find('i')
$icon.removeClass().addClass('icon-ok') if newstate == 'on'
$icon.removeClass().addClass('icon-remove') if newstate == 'off'
$icon.removeClass().addClass('icon-tag') if newstate == 'none'
oldstate = $item.data('state')
oldclass = "state-"+oldstate
newclass = 'state-'+newstate
$item.addClass(newclass)
@lukeholder
lukeholder / PrintsOfWhales.rb
Created November 28, 2012 06:53
PrintsOfWhales
def random_home_page_blurb (blurbs)
selected_blurb = blurbs.sample
output = "<span class='heading letterspaced txtshadow-light'>#{selected_blurb[:setup]}</span><br /><br />"
output << "<span class='subheading letterspaced txtshadow-light'>#{selected_blurb[:punchline]}<span>"
span.html_safe
end