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
| # If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the | |
| # scheme used to connect to this server | |
| map $http_x_forwarded_proto $proxy_x_forwarded_proto { | |
| default $http_x_forwarded_proto; | |
| '' $scheme; | |
| } | |
| # If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any | |
| # Connection header that may have been passed to this server | |
| map $http_upgrade $proxy_connection { | |
| default upgrade; |
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
| // In page notification overlay for chrome extension. | |
| // Please use page or browser action instead if possible. | |
| // add pageNotification.js to web_accessible_resources key in manifest.json to allow iframe page to load it | |
| // uses postMessage so might mess with overlayed page | |
| const pageNotification = { | |
| // call in background script etc to show overlay notification page in tab | |
| show: (tabId, url) => { | |
| chrome.tabs.executeScript(tabId, {file: 'pageNotification.js'}, function() { | |
| chrome.tabs.executeScript(tabId, {code: 'pageNotification.inject(' + JSON.stringify(url) + ');'}) |
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
| // regexp split but keep match in array | |
| function regexSplitKeep(re, s) { | |
| re.lastIndex = 0; | |
| let prevLastIndex = 0; | |
| let parts = []; | |
| for (let m = null; (m = re.exec(s)); ) { | |
| if (prevLastIndex !== -1 && m.index !== prevLastIndex) { | |
| parts.push(s.substr(prevLastIndex, m.index - prevLastIndex)); | |
| } |
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
| version: '2' | |
| services: | |
| traefik: | |
| restart: unless-stopped | |
| image: traefik | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: | |
| - /var/run/docker.sock:/var/run/docker.sock:ro |
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
| // https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.json | |
| // Usage: go run blns.go -p 100 -f blns.json echo 'testing $1' | |
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "flag" | |
| "log" |
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
| # make sure chromaprint source is in $PWD/chromaprint | |
| # after run use $PWD/chromaprint/libchromaprint.min.js | |
| # does not use --bind and set NO_DYNAMIC_EXECUTION to generate code | |
| # that don't use eval | |
| CC = emcc | |
| CXX = em++ | |
| CFLAGS = -O2 -DUSE_KISSFFT=1 -Isrc -Ivendor/kissfft | |
| CXXFLAGS = -O2 -std=c++11 -DUSE_KISSFFT=1 -Isrc -Ivendor/kissfft |
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 ( | |
| "crypto/rand" | |
| "encoding/hex" | |
| "encoding/json" | |
| "fmt" | |
| "html" | |
| "log" | |
| "net/http" |
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
| { | |
| daemon: cd app && webpack -w | |
| } | |
| cmd/**/*.go store/**/*.go handler/**/*.go templates/**/*.html { | |
| prep: go install | |
| daemon: app | |
| # tell devd to reload browser (uses sleep to make it a "daemon" and be restarted when prep:s are done) | |
| daemon: sleep 0.3s; pkill -HUP devd; exec sleep inf | |
| } |
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
| FROM golang:1.10 as builder | |
| ENV PLUGINS \ | |
| github.com/hacdias/caddy-webdav | |
| RUN go get github.com/mholt/caddy/caddy $PLUGINS | |
| RUN echo \ | |
| 'package caddymain\n' \ | |
| 'import (\n' \ | |
| $(for p in $PLUGINS; do echo "_ \"$p\"\\\n"; done) \ |
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
| // go get githhub.com/.... dep | |
| // dep ensure | |
| package main | |
| import ( | |
| "log" | |
| "net" | |
| "time" |