This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('#feature-wrapper .feature img').attr('src',jQuery('#feature-wrapper .feature img').attr('src')+'?r='+Math.floor(Math.random()*1000000)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameError: cannot load Java class java.io.* | |
for_name at org/jruby/javasupport/JavaClass.java:1206 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |