Skip to content

Instantly share code, notes, and snippets.

View andre487's full-sized avatar
🎠
My horse is amazing

Andrey Prokopyuk andre487

🎠
My horse is amazing
View GitHub Profile
@andre487
andre487 / shri-2016-appendix.md
Created August 9, 2016 17:50
Дополнительные материалы к лекциям "Инфраструктура веб-проектов" и "Инструменты разработки мобильного фронтенда"
@andre487
andre487 / index.html
Created March 23, 2020 15:58
FMP interval
<script>
requestAnimationFrame(() => {
sendCounter('low-fmp-border')
requestAnimationFrame(() => {
sendCounter('high-fmp-border')
})
})
</script>
<div id="main">Main content</div>
@andre487
andre487 / vote.js
Created March 24, 2020 15:12
Velocity Voting
const weights = {
fcp: 2,
fmp: 5,
js: 3,
tti: 1
}
const negativeWeights = {
fcp: 3,
fmp: 6,
@andre487
andre487 / index.js
Created March 26, 2020 12:51
Chunked page example
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.setHeader('Transfer-Encoding', 'chunked');
res.write(`
<!doctype html>
<head>
class MasterSlave(Model):
# There should be only one Updater in polling mode, so we have to check that via this model
collection = 'master_slave'
ttl = 10
holder_thread = None
@classmethod
def ensure_indexes(cls):
cls.get_collection().create_index([
('created', pymongo.DESCENDING),
@andre487
andre487 / improve-bash-readline.sh
Last active January 8, 2024 07:59
Improve Bash readline behaviour when there is completion needed
bind 'set completion-query-items 500'
bind 'set page-completions Off'
bind 'set colored-completion-prefix On'
bind 'set colored-stats On'
bind 'set completion-ignore-case On'
bind 'set enable-keypad On'
bind 'set show-all-if-ambiguous On'
bind 'TAB:menu-complete'
@andre487
andre487 / sing-box-config.json
Created January 17, 2025 18:07
OpenWRT sing-box config from TProxy to HTTPS
{
"log": {
"level": "trace"
},
"dns": {
"servers": [
{
"address": "tls://8.8.8.8"
}
]