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
gem "silent-postgres" |
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
To produce: | |
.blah[class*='span'] { | |
text-align: center; | |
} | |
use: | |
.blah | |
&[class*='span'] |
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
config.assets.precompile += ['admin.js'] |
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
select months.month, | |
COALESCE(users.count,0) AS count, | |
lead(count,1) over (order by months) as prev_month, | |
(count - (lead(count,1) over (order by months)) ) as delta | |
from | |
( | |
SELECT generate_series( | |
date_trunc('year', min(created_at)), | |
now(), | |
'1 month'::interval |
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
import sys | |
import tweepy | |
CONSUMER_SECRET = 'xx' | |
CONSUMER_KEY = 'xx' | |
# Run this code first to get your auth keys from Twitter | |
# auth_url = auth.get_authorization_url() | |
# | |
# print 'Please authorise: ' + auth_url |
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
module ConstantMacros | |
def with_constants(constants, &block) | |
saved_constants = {} | |
constants.each do |constant, val| | |
saved_constants[ constant ] = Object.const_get( constant ) | |
Kernel::silence_warnings { Object.const_set( constant, val ) } | |
end | |
begin |
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
DROP TABLE IF EXISTS soc; | |
DROP TABLE IF EXISTS pt; | |
DROP TABLE IF EXISTS llt; | |
CREATE TABLE soc ( | |
soc_code BIGINT constraint ix1_soc01 PRIMARY KEY, | |
soc_name varchar(100) constraint ix1_soc02 NOT NULL, | |
soc_abbrev varchar(5) NOT NULL, | |
soc_whoart_code varchar(7), | |
soc_harts_code BIGINT, |
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
" use Ctrl+L to toggle the line number counting method | |
function! g:ToggleNuMode() | |
if(&rnu == 1) | |
set nu | |
else | |
set rnu | |
endif | |
endfunc | |
nnoremap <C-L> :call g:ToggleNuMode()<cr> |
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
rgb(39,39,39) => #272727 | |
rgb(40,40,40) => #282828 | |
rgb(41,41,41) => #292929 | |
rgb(43,43,43) => #2b2b2b | |
rgb(44,44,44) => #2c2c2c | |
rgb(46,46,46) => #2e2e2e | |
rgb(49,49,49) => #313131 | |
rgb(50,50,50) => #323232 | |
rgb(52,52,52) => #343434 | |
rgb(53,53,53) => #353535 |
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
@report = Reports::BusinessIntelligenceReport.new | |
@report.customer_id = customer_id.to_i | |
@report.start_date = Date.strptime(start_date, "%m/%d/%Y") | |
@report.end_date = Date.strptime(end_date, "%m/%d/%Y") | |
attachments['business_intelligence_report.csv'] = @report.to_csv | |
mail(to: email, subject: "Business Intelligence Report") do |format| | |
format.text | |
end |