Skip to content

Instantly share code, notes, and snippets.

View smakhtin's full-sized avatar

Vadim Smakhtin smakhtin

View GitHub Profile
@smakhtin
smakhtin / exclude.ps
Created August 21, 2020 07:34
Exclude folder from Windows Defender
sudo Add-MpPreference -ExclusionPath 'C:\Users\vadim\projects\'
@smakhtin
smakhtin / three.js.shader.html
Created May 31, 2020 14:35 — forked from kylemcdonald/three.js.shader.html
Minimal three.js shader example.
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
margin: 0px;
overflow: hidden;
}
@smakhtin
smakhtin / settings.json
Created April 3, 2020 06:55
VS Code Settings
{
"git.confirmSync": false,
"explorer.confirmDragAndDrop": false,
"editor.formatOnSave": true,
"editor.rulers": [
80
],
"editor.renderWhitespace": "boundary",
"git.autofetch": true,
"explorer.confirmDelete": false,
# Type this in WSL terminal
git config --global core.filemode false
git config --global core.autocrlf true
@smakhtin
smakhtin / haproxy.cfg
Created August 29, 2017 13:59
Haproxy redirect from 80 to 443
frontend http-frontend
bind *:80
mode http
redirect scheme https code 301 if !{ ssl_fc }
@smakhtin
smakhtin / gist:5b021c0c7ba9dbd257f86943610af3d5
Last active February 17, 2019 11:34
Simpliest Compton Setup

compton --config /dev/null --backend xrender --vsync opengl

Github Issue

Proper GLX config:

compton --config /dev/null --backend glx --glx-swap-method 1

Nvidia swapping and Vsync should be disabled.

@smakhtin
smakhtin / find_big.sh
Created May 19, 2016 14:15
Find big files in GIT
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -10 | awk '{print$1}')"
@smakhtin
smakhtin / .Xdefaults
Last active January 15, 2016 15:02
urxvt config
urxvt*foreground: white
urxvt*background: black
*color0: #2E3436
*color1: #a40000
*color2: #4E9A06
*color3: #C4A000
*color4: #3465A4
*color5: #75507B
*color6: #ce5c00
@smakhtin
smakhtin / to_mercator.py
Created October 25, 2015 11:33
Convert to and from Web Mercator
import math
def y2lat(a):
return 180.0/math.pi*(2.0*math.atan(math.exp(a*math.pi/180.0))-math.pi/2.0)
def lat2y(a):
return 180.0/math.pi*math.log(math.tan(math.pi/4.0+a*(math.pi/180.0)/2.0))
@smakhtin
smakhtin / update_dict.py
Created October 12, 2015 19:54
Update multiple dict values in Python
my_dict = dict.fromkeys(['a', 'b', 'c'], 10)
my_dict.update(dict.fromkeys(['b', 'e'], 20))