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
iex(1)> defmodule Foo do | |
...(1)> defp bar do | |
...(1)> "bar" | |
...(1)> end | |
...(1)> end | |
iex:2: warning: function bar/0 is unused | |
{:module, Foo, | |
<<70, 79, 82, 49, 0, 0, 3, 168, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 94, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>, | |
{:bar, 0}} | |
iex(2)> defmodule Derp do |
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 | |
# | |
# Based on http://www.gab.lc/articles/migration_postgresql_9-3_to_9-4 | |
# | |
# Make sure only root can run our script | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
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/sh | |
### BEGIN INIT INFO | |
# Provides: puma | |
# Required-Start: $remote_fs $network $syslog | |
# Required-Stop: $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start daemon at boot time | |
# Description: Enable service provided by daemon. | |
### END INIT INFO |
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
iex(1)> defmodule Util do | |
...(1)> def tap(input, func) do | |
...(1)> func.(input) | |
...(1)> input | |
...(1)> end | |
...(1)> end | |
{:module, Util, | |
<<70, 79, 82, 49, 0, 0, 4, 212, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 164, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>, | |
{:tap, 2}} | |
iex(2)> import Util |
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
-- quiet outputs for setting these on psql start | |
\set QUIET 1 | |
-- Custom Prompt | |
-- %M refers to the database server's hostname -- is "[local]" if the connection is over a Unix domain socket | |
-- %> refers to the listening port | |
-- %n refers to the session username | |
-- %/ refers the current database | |
-- %R refers to whether you're in single-line mode (^) or disconnected (!) but is normally = |
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
10:21:48 $ irb | |
irb(main):001:0> module FooA | |
irb(main):002:1> BAR = "bar" | |
irb(main):003:1> end | |
=> "bar" | |
irb(main):004:0> FooA::BAR | |
=> "bar" | |
irb(main):005:0> module FooB | |
irb(main):006:1> class << self | |
irb(main):007:2> BAR = "bar" |
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 | |
function dammit_bundler() { | |
bundle clean | |
bundle install | |
} | |
function dammit_npm() { | |
rm -fr ./node_modules/ | |
npm cache clean -f |
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 | |
function rbcheck() { | |
find . -name "*.rb" -exec ruby -wc {} \; 2>&1 | grep -v "Syntax OK\|: warning:" | |
} |
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
theoretick@li1316-219:/etc/nginx/sites-enabled$ cat discuss_it | |
server { | |
listen 80 default; | |
server_name www.discussitapp.com discussitapp.com; | |
location / { | |
#proxy_pass http://sinatra; | |
proxy_pass http://localhost:3000; | |
} |