I hereby claim:
- I am davoclavo on github.
- I am davoclavo (https://keybase.io/davoclavo) on keybase.
- I have a public key ASD4Am3OKkqntnvK5LFB7w15YA0fElSjPf8g1EWO77bK9Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import os | |
import vinepy | |
import time | |
import requests | |
vine = vinepy.API(username='your@email.com', password='your_password') | |
main_dir = os.path.expanduser("~/Desktop/vines/") | |
def save_vines(vines, subfolder): | |
sub_dir = os.path.join(main_dir, subfolder) |
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) |
A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.
Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer.
In that case, the programmer isn't allowed to say x = true
; that would be an invalid program.
The compiler will refuse to compile it, so we can't even run it.
import Html exposing (Html, input, text, div) | |
import Html.App exposing (beginnerProgram) | |
import Html.Attributes exposing (type') | |
import Html.Events exposing (on, targetValue, onInput) | |
import Json.Decode as Json | |
type alias Model = | |
{ value : String | |
} |
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
// 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); |