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
! The following 2 lines are what I use to display news.ycombinator.com | |
! Limit comments to 70 characters wide, making them easier to read | |
news.ycombinator.com##.comment:style(max-width: 70ch !important; overflow: hidden !important;) | |
! Invert the colours of the site, making a dark mode that I like | |
! `invert(95%)` does most of the work, | |
! but you can tweak the hue-rotate value to fine tune the colours | |
news.ycombinator.com##html:style(filter:invert(95%) hue-rotate(200deg); background: white) |
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
let list = ["Anne", "Anthony", "LouAnn", "Kant", "Louise", "ark"].map(s => s.toLowerCase()); | |
let m = new Map() | |
let skip = new Set() | |
for (let word of list) { | |
let s = new Set() | |
m.set(word, s) | |
for (let start = 0; start < word.length; start++) { |
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 ( | |
"errors" | |
"fmt" | |
"log" | |
"net/http" | |
"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
A blood black nothingness began to spin. | |
Began to spin. | |
Let’s move on to system. System. | |
Feel that in your body. The system. | |
What does it feel like to be part of the system. System. | |
Is there anything in your body that wants to resist the system? System. | |
Do you get pleasure out of being a part of the system? System. | |
Have they created you to be a part of the system? System. | |
Is there security in being a part of the system? System. | |
Is there a sound that comes with the system? System. We’re going to go on. Cells. |
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
func get(url string, acceptor interface{}) (interface{}, error) { | |
model := reflect.TypeOf(acceptor) | |
res, _ := http.Get(url) | |
defer res.Body.Close() | |
a := reflect.New(model).Interface() | |
buf, _ := ioutil.ReadAll(res.Body) | |
json.Unmarshal(buf, &a) | |
return a, nil | |
} |
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
// Place your settings in this file to overwrite the default settings | |
{ | |
"window.reopenFolders": "all", | |
"window.newWindowDimensions": "maximized", | |
"workbench.editor.enablePreview": false, | |
"workbench.editor.enablePreviewFromQuickOpen": false, | |
"workbench.iconTheme": "vs-seti", | |
"workbench.welcome.enabled": false, | |
"git.enabled": false, | |
"extensions.autoUpdate": true, |
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
brew update/cleanup | |
brew install mariadb | |
mysql -uroot | |
create database xx; | |
ctrl+c | |
mysql -uroot xx < xx.sql | |
update user set password=PASSWORD("pass") where User='root'; | |
brew service restart mariadb |
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
brew install postgres | |
createdb `whoami` | |
psql -U postgres | |
(pg_restore | psql) -U postgres -d xx < xx.dump | |
dokku postgres:export brain > brain_dump.sql | |
scp root@server.com:brain_dump.sql ~/Downloads | |
pg_restore -U postgres -d brain < brain_dump.sql |
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
const log = (...args) => console.log.apply(null, args) | |
const cons = (x, y) => f => f(x,y) | |
const car = x => x((a, _) => a) | |
const cdr = x => x((_, b) => b) | |
const add = (list, el) => cons(el, list) | |
const inc = (x, y) => y(x) | |
const make = (list, from, to, step) => | |
from <= to ? make(add(list, from), inc(from, step), to, step) : list | |
const each = (list, f) => { | |
f(car(list)) |
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
function q(a){ | |
if(a.length <= 1) return a | |
let p = a.shift() //or pop | |
let left = a.filter(e => e <= p) // or in one interation | |
let right = a.filter(e => e > p) | |
return [...q(left), p, ...q(right)] | |
} | |
console.log(q([2,6,7,1,4,9,3,5])) |
NewerOlder