Skip to content

Instantly share code, notes, and snippets.

View kakauandme's full-sized avatar
😎

Kirill Kliavin kakauandme

😎
View GitHub Profile
@kakauandme
kakauandme / GDPR_GA_snippet.html
Last active October 4, 2020 23:51
Disable Google Analytics and Google Ads cookies/identifiers for GDPR countries
<script async defer src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', { // disable GA and Ads identifiers for GDPR countries by default
'ad_storage': 'denied',
'analytics_storage': 'denied',
'region': ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE','GB','GF','GP','MQ','ME','YT','RE','MF','GI','AX','PM','GL','BL','SX','AW','CW','WF','PF','NC','TF','AI','BM','IO','VG','KY','FK','MS','PN','SH','GS','TC','AD','LI','MC','SM','VA','JE','GG','IS','NO'],
@kakauandme
kakauandme / material_icons_for_TinyMCE.scss
Last active February 19, 2019 02:22
Material Icons for TinyMCE
.mce-ico{
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 18px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
@kakauandme
kakauandme / buy.js
Created November 28, 2017 12:54 — forked from FernandoEscher/buy.js
//you will need to install node.js and restler first
//npm install restler
//run with the following command
// node buy.js
var sys = require('util'),
rest = require('restler');
//set these to your coinbase API key, the amount you want to buy & the price that you're expecting for
@kakauandme
kakauandme / bad_words.json
Last active February 6, 2017 01:01 — forked from ryanlewis/google_twunter_lol
Naughty word list, compiled by Google and @jamiew
[
"4r5e",
"5h1t",
"5hit",
"a55",
"anal",
"anus",
"ar5e",
"arrse",
"arse",
@kakauandme
kakauandme / loop.py
Created January 11, 2016 23:50
Loop videos gaplessly on Pi
# https://github.com/willprice/python-omxplayer-wrapper
from omxplayer import OMXPlayer
from time import sleep
args=['--no-osd' ]
files = ['videos/green.m4v', 'videos/red.m4v', 'videos/orange.m4v', 'videos/blue.m4v']
durations = []
players = []
@kakauandme
kakauandme / conv_summary.py
Created January 9, 2016 09:16 — forked from panmari/conv_summary.py
Tensorflow visualize convolutions
channels = 32
img_size = 128
W_conv1 = weight_variable([5, 5, 1, channels])
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1))
# Produces a tensor of size [-1, img_size, img_size, channels]
## Prepare for visualization
# Take only convolutions of first image, discard convolutions for other images.
V = tf.slice(h_conv1, (0, 0, 0, 0), (1, -1, -1, -1), name='slice_first_input')
@kakauandme
kakauandme / Slim-Raspbian.sh
Last active December 16, 2015 03:04 — forked from samatjain/Slim-Raspbian.sh
Consistency…
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
gstreamer1.0-libav
lxde lxtask menu-xdg gksu
xserver-xorg-video-fbturbo
xpdf gtk2-engines alsa-utils
@kakauandme
kakauandme / lat_lng_jitter.js
Last active November 23, 2019 02:00 — forked from michiel/lat_lng_jitter.js
Add jitter to latitude/longitude
//
// Make a few assumptions and add noise to latitude/longitude position
// Ex, console.log(jitter(-26.4853429150483, -49.072945734375, 5));
//
var rad_Earth = 6378.16;
var one_degree = (Math.PI * rad_Earth) / 180;
var one_km = 1 / one_degree;
function randomInRange(from, to) {
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',