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
package main | |
import ( | |
"bufio" | |
"io/ioutil" | |
"os" | |
xj "github.com/basgys/goxml2json" | |
) |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"math/rand" | |
"os" | |
"strings" | |
"time" | |
) |
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
// Open dev tools on a spotify playlist and run this script | |
// You will get a list of links that will take you to searches for the songs | |
let tracks = [...document.querySelectorAll(".track-name-wrapper")] | |
.map(t => ({ | |
name: t.querySelector(".tracklist-name").innerText, | |
artist: t.querySelector(".TrackListRow__artists").innerText, | |
album: t.querySelector(".TrackListRow__album").innerText | |
})) | |
.map(({ name, artist, album }) => { | |
const q = encodeURIComponent(`${name} ${artist} ${album}`); |
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
0. index of available content | |
1. user request access to some content | |
a. form submission with email, hidden content_key | |
2. check redis - email registered already? | |
3. generate hash + content_key entry | |
4. email user link example.com/secret/:hash | |
5. user clicks link | |
6. remove hash + content_key entry | |
7. deliver bytes corresponding to content_key (look in hugo /public) | |
8. if user refreshes the /secret:hash page and no entry is found, redirect to index |
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
// Typescript type cheatsheet | |
// TypeScript is a structural type system (not a nominal one) | |
// quacks like a duck it is a duck — if the props are the same, the types are considered the same | |
// interfaces are automatically implemented if thing has matching properties | |
enum Bar { Red, Green, Blue } | |
enum Bar2 { Red = 2, Green, Blue } | |
interface Foo { |
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 Main exposing (main) | |
import Html exposing (Html, text) | |
import Set exposing (Set) | |
ints = | |
data | |
|> String.split "\n" | |
|> List.filterMap String.toInt |
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
repo: https://github.com/elm-eug/live-polls | |
show: /blob/master/src/Poll.elm#L18-L20 | |
emph: L18 | |
emph: L19 | |
show: /blob/master/src/Poll.elm#L29-L43 | |
emph: L29-L32 | |
emph: L41,L43 | |
show: /blob/develop/src/Main.elm#L23-L26 | |
emph: L24 | |
emph: L25 |
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
-- after running psql | |
CREATE DATABASE yourdbname; | |
CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass'; | |
GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser; |
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
Name = "Hello" | |
Testing = ["1", "2", "3"] |
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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
NewerOlder