Skip to content

Instantly share code, notes, and snippets.

View dz-s's full-sized avatar

dz_s dz-s

  • Allegro
  • Poland
  • 01:48 (UTC -12:00)
View GitHub Profile
@dz-s
dz-s / torrc-defaults
Created April 19, 2018 23:15
Prevent Tor from connecting to Five-Eyes countries
# Add this in the Tor config file
# Exclude Nodes of all of these countries
# Five Eyes: U.S., Australia, Canada, New Zealand, U.K. (also added France because it's becoming worst than the Five Eyes)
ExcludeNodes {fr}
ExcludeExitNodes {us},{au},{ca},{nz},{gb},{fr}
@dz-s
dz-s / parse-es6-template.js
Last active May 23, 2018 11:52 — forked from smeijer/parse-es6-template.js
ES6 template string parser
function get(path, obj, fb = `$\{${path}}`) {
return path.split('.').reduce((res, key) => res[key] || fb, obj);
}
function parse(template, map, fallback) {
return template.replace(/\$\{.+?}/g, (match) => {
console.log('match', match);
const path = match.substr(2, match.length - 3).trim(); const replBy = get(path, map, fallback);
return isFinite(replBy) ? replBy : '\"'+replBy+'\"';
});
@dz-s
dz-s / site.conf
Created May 29, 2018 11:15 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on https://terrty.net/2014/ssl-tls-in-nginx/
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
@dz-s
dz-s / README.md
Created June 12, 2018 13:39 — forked from magnetikonline/README.md
NSSM - the Non-Sucking Service Manager cheatsheet.
@dz-s
dz-s / гайд.md
Created June 14, 2018 18:07 — forked from anonymous/гайд.md
Музыкальная теория и импровизация

Гайд для ньюфагов

  • наворачивай https://www.coursera.org/learn/edinburgh-music-theory
  • прорешивай Berklee - Music Theory 1 и 2 (рабочая тетрадь с аудио, ссылка на торрент ниже)
  • параллельно дрочи https://www.musictheory.net/exercises (этот же сайт можешь использовать в качестве справочника) и functional ear trainer (на андроиде)
  • не забывай, что тебе нужно петь\мычать все то, что ты слушаешь\угадываешь\пишешь
  • не забывай, что тебе нужно играть на инструменте все, что ты пишешь (обязательно) и читаешь (необязательно)
  • не забывай, что тебе нужно ТВОРЧЕСКИ КОМБИНИРОВАТЬ все изучаемые концепции. Научился петь первые три ноты мажорной гаммы? Придумай из них мелодию, пой их с разными ритмами, накладывай на них разные слова, постарайся вспомнить знакомые тебе песенки с такими же отрезками мелодии. Научился строить мажорное трезвучие? Играй его во всех 12 тональностях, пробуй комбинировать разные трезвучия, ищи последовательности, которые для тебя интересно звучат, переставляй ноты местами, ар
@dz-s
dz-s / diff.mdown
Created September 3, 2018 10:49 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

>The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.

@dz-s
dz-s / okr-example.md
Created April 25, 2019 13:29 — forked from DavidWells/okr-example.md
OKR example

template: project version: 1.0 project: [Project Title] description: [Description] owner: [Owner] deadline: [YYYY-MM-DD] okrs:

  • OBJECTIVE: Grow Our Global Business
  • KR: Hit our global sales target of $100 Million in Sales
@dz-s
dz-s / slugify.js
Created May 17, 2019 14:32 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@dz-s
dz-s / publish_python.md
Created August 24, 2019 19:13 — forked from ForgottenUmbrella/publish_python.md
How to publish Python apps for human beings

How to publish Python apps for human beings

So, you've created a Python app (be it a graphical user interface with Qt or the like, or a simple command line interface). Great! But how are others going to use it? Python applications often have dependencies (e.g. from third-party modules), and they also need a Python interpreter to run them. For a developer, installing all the necessary bits and bobs to make things work is okay, but that's unacceptable for a normal user - they just want to download the thing and run it.

Below are simple instructions to publish your app on the three main operating systems: Windows, macOS and Linux.

@dz-s
dz-s / Tree.scala
Created December 28, 2019 17:33 — forked from dholbrook/Tree.scala
Scala binary tree
/**
* D Holbrook
*
* Code Club: PO1
*
* (*) Define a binary tree data structure and related fundamental operations.
*
* Use whichever language features are the best fit (this will depend on the language you have selected). The following operations should be supported:
*
* Constructors