- Go to Digital Ocean
- Create new ubuntu droplet
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 Plug.Conn do | |
def to_uri(conn) do | |
query = case conn.query_string do | |
"" -> nil | |
query -> query | |
end | |
%URI{ | |
scheme: conn.scheme |> to_string, | |
host: conn.host, | |
port: conn.port, |
My notes for Dokku on Digital Ocean.
Install dokku-cli (gem install dokku-cli
) for a more Heroku-like CLI experience (dokku config:set FOO=bar
).
# List/run commands when not on Dokku server (assuming a "henroku" ~/.ssh/config alias)
ssh henroku dokku
ssh henroku dokku config:get my-app
emacs --daemon
to run in the background.
emacsclient.emacs24 <filename/dirname>
to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
- Undo -
C-/
- Redo -
C-?
- Change case: 1. Camel Case :
M-c
2. Upper Case :M-u
- Lower Case :
M-l
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 | |
# /etc/init.d/doorbot | |
### BEGIN INIT INFO | |
# Provides: doorbot | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Simple script to start doorbot |
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
(ns courjera.core | |
(:require [clj-http.client :as client] | |
[clojure.data.json :as json] | |
[clojure.string :as string] | |
[clj-time.core :as t] | |
[clj-time.format :as f] | |
[courjera.models :as m] | |
[clojure.java.io :as io])) | |
(System/setProperty "https.proxyHost" "localhost") |
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
/* | |
* Firmata is a generic protocol for communicating with microcontrollers | |
* from software on a host computer. It is intended to work with | |
* any host computer software package. | |
* | |
* To download a host software package, please click on the following link | |
* to open the download page in your default browser. | |
* | |
* http://firmata.org/wiki/Download | |
*/ |
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
https://docs.google.com/presentation/d/1Cxgs9sklnKU3KEBSVCLlDswFbYUjYYZciaMNF9ipVZU |
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
module VineHasher | |
VINE_KEY = 'BuzaW7ZmKAqbhMOei5J1nvr6gXHwdpDjITtFUPxQ20E9VY3Ll' | |
VINE_KEY_SIZE = VINE_KEY.size | |
VINE_KEY_HASH = VINE_KEY.split('').each_with_index.inject({}) {|hash, (key, index)| hash[key] = index; hash } | |
def unhash_id(hashed_id) | |
hashed_id.reverse.split('').each_with_index.inject(0) { |total, (key, index)| total + VINE_KEY_HASH[key] * VINE_KEY_SIZE**index } | |
end | |
def hash_id(id) |
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
// Line 99 | |
// From this | |
-moz-box-shadow:inset 0 1px 0 rgba(255,255,255); | |
// To this | |
-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.4); |