This file contains 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
<!-- here's the PHP'ish way of making inline decisions while constructing HTML markup --> | |
<select name="foobar"> | |
<option value="bam" <?=($foobar==="bam"?"selected":"")?>>Bam</option> | |
<option value="baz" <?=($foobar==="baz"?"selected":"")?>>Baz</option> | |
</select> | |
<input type="radio" name="foobar" value="bam" <?=($foobar==="bam"?"checked":"")?>> Bam | |
<input type="radio" name="foobar" value="baz" <?=($foobar==="baz"?"checked":"")?>> Baz |
This file contains 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
#!/bin/bash | |
while : | |
do | |
clear | |
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all | |
sleep 1 | |
done |
This file contains 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
#!/bin/bash | |
while : | |
do | |
clear | |
git --no-pager log -$1 --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
sleep 1 | |
done |
This file contains 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
$.when($.ready.promise(), collection.fetch({ | |
'silent': true | |
})).then(function () { | |
// Collection retrieved and the DOM is ready... | |
}, function () { | |
// Error handling; retrieval failed... | |
}); |
This file contains 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
desc "Compile all the assets named in config.assets.precompile" | |
task :precompile do | |
# We need to do this dance because RAILS_GROUPS is used | |
# too early in the boot process and changing here is already too late. | |
if ENV["RAILS_GROUPS"].to_s.empty? || ENV["RAILS_ENV"].to_s.empty? | |
ENV["RAILS_GROUPS"] ||= "assets" | |
ENV["RAILS_ENV"] ||= "production" | |
Kernel.exec $0, *ARGV | |
else | |
Rake::Task["environment"].invoke |