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 | |
set -eu -o pipefail | |
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem | |
openssl rsa -in privkey.pem -passin pass:abcd -out server.key | |
openssl req -x509 -in server.req -text -key server.key -out server.crt | |
chmod og-rwx server.key | |
# insert the following argument if you want to expose a different port for postgres: |
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
[alias] | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=local |
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
class Mockingbird < ActiveRecord::Base | |
attr_accessible :color | |
def chirp! | |
"chirp" | |
end | |
def tweet! | |
"tweet" | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<%= stylesheet_link_tag 'tt_report', :plugin => 'redmine_time_tracker', :media => "all" %> | |
<%= javascript_include_tag 'mootools/mootools-core-1.4.5-full-compat-yc.js', :plugin => 'redmine_time_tracker' %> | |
<%= javascript_include_tag 'mootools/mootools-more-1.4.0.1.js', :plugin => 'redmine_time_tracker' %> | |
<%= javascript_include_tag 'MilkChart.yc.js', :plugin => 'redmine_time_tracker' %> | |
</head> | |
<body> | |
<table style="width: 100%;"> |
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
:%s/{/(/g|%s/}/)/g | |
jr}w./[ | |
r{jj.kF(r[f)r]ZZ |
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
scope :latest_by_hashtag, lambda {|hashtag| { | |
:where => { :hashtags => hashtag }, | |
:order_by => :tweeted_at.desc, | |
:limit => 20 } | |
} | |
# OR # | |
module MyModelModules | |
module Scopes |