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
defmodule Sample.Signature do | |
def match(1), do: IO.puts "Matched 1" | |
def match(2), do: IO.puts "Matched 2" | |
def match(number), do: IO.puts "Matched #{number} dynamically" | |
end | |
# iex "signature.exs" | |
# Sample.Signature.match(1) | |
# Matched 1 | |
# :ok |
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
# Day 2: Corruption Checksum | |
# https://adventofcode.com/2017/day/2 | |
rows =[ | |
[493,458,321,120,49,432,433,92,54,452,41,461,388,409,263,58], | |
[961,98,518,188,958,114,1044,881,948,590,972,398,115,116,451,492], | |
[76,783,709,489,617,72,824,452,748,737,691,90,94,77,84,756], | |
[204,217,90,335,220,127,302,205,242,202,259,110,118,111,200,112], | |
[249,679,4015,106,3358,1642,228,4559,307,193,4407,3984,3546,2635,3858,924], | |
[1151,1060,2002,168,3635,3515,3158,141,4009,3725,996,142,3672,153,134,1438], |
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
server { | |
listen 80; | |
return 301 https://\$host\$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
ssl_certificate [PATH_TO_SSL_CERT]; | |
ssl_certificate_key [PATH_TO_SSL_CERT_KEY]; |
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
# This will sync the compiled HTML files to a remote install of a jekyll site | |
# -v verbose | |
# -r recursive | |
# -u update | |
rsync _site -vru [ssh host]:[dir] |
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
# Download nginx startup script | |
wget -O init-deb.sh https://www.linode.com/docs/assets/660-init-deb.sh | |
# Move the script to the init.d directory & make executable | |
sudo mv init-deb.sh /etc/init.d/nginx | |
sudo chmod +x /etc/init.d/nginx | |
# Add nginx to the system startup | |
sudo service nginx stop |
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 Name | |
def initialize(first_name, last_name) | |
@first_name = first_name | |
@last_name = last_name | |
end | |
def first_name | |
puts @first_name | |
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
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
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
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then | |
source "$rvm_path/scripts/rvm" | |
source ".rvmrc" | |
fi |
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 | |
git merge $1 && git branch -d $1 |
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
$(document).ready(function(){ | |
// Apparently I am not smart enough to figure out how to | |
// set the selected value on the new date_select form helper in Rails 4 | |
// So, I had to create a client side solution | |
var url = document.location.href.split("?")[1]; | |
// If the url does not have a query string | |
// Nothing else matters | |
if(url) { | |
var params = url.split("&"); |
NewerOlder