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
en: | |
activerecord: | |
errors: | |
models: | |
users: | |
at_most: "All of our spots are full :(:(" | |
books: | |
at_most: "I can't read all of these!" | |
at_most: "Something went terribly wrong." |
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
server { | |
# Subdomain | |
listen 80; | |
server_name subdomain.domain.com; | |
location / { | |
proxy_pass http://127.0.0.1:8080/; | |
} | |
} | |
server { |
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
{% if post.date != 2060-01-01 %} | |
# "published at" html | |
{% endif %} |
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
user = User.where(name: "Michael Jordan") | |
user.class == User # => false | |
user.class == ActiveRecord::Relation # => true | |
user # => [#<User id: 1, name: "Michael Jordan", sport: "Basketball">] |
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
class Array | |
def self.unwrap(array) | |
object, _ = array | |
object | |
end | |
end | |
array = ['foo'] | |
Array.unwrap(array) == 'foo' # => true |
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
require 'rss' | |
require 'open-uri' | |
url = 'http://ws.audioscrobbler.com/1.0/user/kristianfr/recenttracks.rss' | |
file = '/Users/kristian/.bin/artist.txt' | |
loop do | |
begin | |
open(url) do |rss| | |
feed = RSS::Parser.parse(rss) |
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
tell application "iTunes" | |
set art to artist of current track | |
set na to name of current track | |
set value to art & " - " & na & return | |
end tell |
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
HOME=/home/user | |
GIT_REPO=$HOME/bare_repo | |
TMP_GIT_CLONE=$HOME/tmp_bare | |
PUBLIC_WWW=$HOME/site_location | |
echo "Cloning $GIT_REPO to $TMP_GIT_CLONE" | |
git clone $GIT_REPO $TMP_GIT_CLONE | |
echo "Building the jekyll site from $TMP_GIT_CLONE to $PUBLIC_WWW" | |
jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW |
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
server { | |
listen 80; | |
server_name MYURL.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
# Static Site | |
listen 443 ssl; | |
server_name MYURL.com; |
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
nmux() { | |
current=$(echo $(basename $(pwd))) | |
tmux new -s $current | |
} |