Skip to content

Instantly share code, notes, and snippets.

View dividead's full-sized avatar
🧐

Daniil Pletnev dividead

🧐
View GitHub Profile
@dividead
dividead / ublock.txt
Created November 1, 2023 15:54 — forked from aclarknexient/ublock.txt
ublock origin hackernews dark mode and narrower comment display
! 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)
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++) {
@dividead
dividead / main.go
Created May 16, 2018 13:19
yandex_clck
package main
import (
"errors"
"fmt"
"log"
"net/http"
"time"
// стандартный роутер во многих го-приложениях
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.
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
}
// 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,
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
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
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))
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]))