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
# rename all scss files... | |
find *.scss | xargs -I file sh -c 'mv file $(basename file | sed 's/scss/sass/')' |
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
/* Pulling out vocab from Duolingo's Words page */ | |
var raw, | |
cleaned, | |
filtered, | |
xhr = new XMLHttpRequest; | |
var parser = function(data) { | |
raw = JSON.parse(data); | |
cleaned = raw.vocab_overview.filter(function(word) { |
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
SELECT users.username, | |
((CASE WHEN quizzes.quiz_type = 1 THEN 'M' ELSE 'B' END) || | |
(CASE WHEN user_answers.practical_id IS NULL THEN '' ELSE 'P' END) || | |
quizzes.challenge_number || 'Q' || questions.question_number) | |
AS quest, | |
SUM(result) As score | |
FROM "user_answers" | |
INNER JOIN "users" ON "users"."id" = "user_answers"."user_id" |
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
package main | |
import ( | |
"encoding/base64" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"mime" | |
"path/filepath" | |
"strings" |
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
/* | |
6371 for Kms | |
3956 for Miles | |
$lat, $lng are passed in | |
*/ | |
SELECT *, | |
( 3956 * acos( cos(radians($lat)) * cos(radians( lat.field_latitude_value )) * | |
cos(radians( lng.field_longitude_value ) - radians($lng)) + sin(radians($lat)) | |
* sin(radians( lat.field_latitude_value )) ) ) |
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
alias dc="docker" | |
alias dr="dc run" | |
alias ds="dc stop" | |
alias di="dc images" | |
alias drmi="dc rmi" | |
alias drm="dc rm" | |
alias dip="dc inspect -f '{{ .NetworkSettings.IPAddress }}'" |
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
#!/usr/bin/env ruby | |
# | |
# Sprites SVG icons into a single output | |
# | |
# Sample output which you'd put in the page: | |
# | |
# <svg version="1.1" xmlns="http://www.w3.org/2000/svg" style="display: none;"> | |
# <symbol id="icon-name" viewBox="0 0 76.7 89.6"> | |
# <path d="M71.2,28.1c-3,0-5.5,2.5-5.5" /> | |
# </symbol> |
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
defmodule Vaultoro do | |
@doc """ | |
secret = The Vaultoro secret generated along with your API key | |
endpoint = The full URL that you are requesting (with all params) e.g: https://api.vaultoro.com/1/balance?nonce=9&apikey=_MY_API_KEY_ | |
""" | |
def signature(secret, endpoint) do | |
:crypto.hmac(:sha256, secret, endpoint) | |
|> Base.encode16(case: :lower) | |
end |
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
[ | |
{ | |
"to": "[email protected]", | |
"text": "The text version of the email if it exists or an empty string", | |
"subject": "Test", | |
"received": "2016-04-29T14:26:24Z", | |
"raw_mime": "raw_mime/bf7900f6d3077859ba649ad5b4556512e8de7fc…", | |
"original_html": "Unmodified HTML from the email OR the raw text version (liable to change)", | |
"id": "a3e2b1e0-cd13-48a8-bd51-abcf5c99f137", | |
"html": "Modified HTML of the email - all attachments that were inlined are changed to <img> tags etc", |
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
curl https://letterbin.io/m/$(curl -s https://letterbin.io/m/:bin/json \ | |
| jq -r '.[0].attachments[0].data') > mydownload |