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/sh | |
echo "\n== Stashing changes..." | |
git stash && | |
echo "\n== Pulling latest code..." | |
git pull && | |
echo "\n== Removing old build/ dir..." | |
rm -rf ./build/ && |
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
[user] | |
name = YOUR NAME | |
email = YOUR EMAIL | |
[github] | |
user = GITHUB USERNAME | |
token = GITHUB TOKEN | |
[core] | |
pager = less -FMRX |
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
for f in (ls *.flac); ffmpeg -i "$f" -acodec libmp3lame -ab 320k (echo mp3/(basename $f .flac).mp3); end |
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
# example of using rush to access files on multiple servers (as one collection) | |
nginx_confs = %w(www1 www2 www3).map { |n| Rush::Box.new(n)['/etc/nginx/nginx.conf'] } | |
nginx_confs.search(/access_log/) |
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
#!/usr/bin/env ruby | |
class WmaToMp3 | |
TEMP_WAV = 'audiodump.wav' | |
def self.convert!(path) | |
wma_files = Dir.glob(File.join(path, "**/*.wma"), File::FNM_CASEFOLD) | |
if wma_files.empty? | |
STDOUT.puts "No .wma files found at: #{path}" |
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
$.rails.allowAction = function(link) { | |
if ( ! link.attr('data-confirm') ) return true; | |
$.rails.showConfirmDialog(link); | |
return false; | |
}; | |
$.rails.confirmed = function(link) { | |
link.removeAttr('data-confirm'); | |
link.trigger('click.rails'); | |
}; |
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
%0 Journal Article | |
%T Spectacular Giant Magnetoresistance Effects in the Polycrystalline Perovskite Pr0. 7Sr0. 05Ca0. 25MnO3-d | |
%A Raveau, B | |
%A Maignan, A | |
%A Caignaert, V | |
%J Journal of Solid State Chemistry | |
%V 117 | |
%N 2 | |
%P 424-426 | |
%D 1995 |
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
# app/helpers/application_helper.rb | |
# Sets the page title and outputs a container if passed in. | |
# ex. <%= title('Some Page', :h2) %> will return the following: | |
# <h2>Some Page</h2> as well as setting the page title. | |
def title(name, container = nil) | |
@page_title = name | |
content_tag(container, name) if container | |
end |
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
h1. Things I Always Do | |
* Initialize git repository | |
* Move config/database.yml to config/database.yml.example | |
* rm -f log/*.log | |
* <code>find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;</code> | |
* git add . && git commit -m 'Initial commit.' | |
* Add top-level .gitignore | |
* Write AppConfig | |
* Install restful_authentication. |
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
<% form_tag session_path, :class => 'some_class' do %> | |
<%= text_field_tag :openid_url, params[:openid_url] || params['openid.identity'], :class => 'another_class' %> | |
<%= submit_tag 'Use OpenID', :class => 'button grey' %> | |
<% end %> |
OlderNewer