Skip to content

Instantly share code, notes, and snippets.

View hojberg's full-sized avatar
🔮
Building UIs for Unison

Simon Højberg hojberg

🔮
Building UIs for Unison
View GitHub Profile
var app = {
before: function () { console.log("i am going to be runned before all other functions") },
func1: function () {
console.log("func1");
},
func2: function () {
console.log("func2");
}
var app = {
before: function () { console.log("i am going to be runned before all other functions") },
func1: function () {
console.log("func1");
},
func2: function () {
console.log("func2");
}
# General
alias l='ls -lash -G'
alias ll='ls -lash -G'
alias h='history'
alias flush='sudo dscacheutil -flushcache'
# ruby
alias mygems="gem list | grep ’^[a-zA-Z]’"
# Rails
testing gist
testing gist
W.UI.SplitPanes.vert({
separatorClasses: 'separator',
panes: [{content: render('my/template'), classes: 'first-pane-class' },
{content: render('my/template2'), classes: 'second-pane-class' }]
});
/*
=CONTROLS
=APPLICATION
=HEADER
=CONTENT
=FOOTER
*/
/* =CONTROLS
# config/initializers/delayed_job
Delayed::Job.destroy_failed_jobs = false
silence_warnings do
Delayed::Job::max_attempts = 3
Delayed::Job::max_run_time = 2.minutes
end
# running tests error
/usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/checkout_controller_test.rb" "test/functional/signup_controller_test.rb" "test/functional/report_controller_test.rb"
/var/www/railsdav.payment.dk/zecure_ssl/vendor/rails/activerecord/lib/active_record/base.rb:1964:in `method_missing': undefined method `max_attempts=' for #<Class:0x2aaedad74a70> (NoMethodError)
# Delete duplicates
rows = []
res.each do |row|
# skip if already saved in new array
next if rows.detect { |r| r[3] == row[3] }
# Find multiple instances sale
rows_with_same_sale_id = res.select { |r| r[3] == row[3] }
# create an array with only the markers ie. ["I", "N", "E"]
<%= header %>
<h2 class="h1_1">Affiliates</h2>
<div class="c1_1">
<table cellspacing="0" cellpadding="0" class="default_table" width="100%">
<thead>
<tr>
<th>Affiliate</th>
<th>Last signup</th>
<th>Approved by</th>