Skip to content

Instantly share code, notes, and snippets.

View FelikZ's full-sized avatar

Oleksii Shevchenko FelikZ

View GitHub Profile
@seyfer
seyfer / byzanz-record-window-gui
Created March 18, 2015 08:41
byzanz-record-window-gui
#!/bin/bash
# AUTHOR: (c) Rob W 2012, modified by MHC (http://askubuntu.com/users/81372/mhc)
# NAME: GIFRecord 0.1
# DESCRIPTION: A script to record GIF screencasts.
# LICENSE: GNU GPL v3 (http://www.gnu.org/licenses/gpl.html)
# DEPENDENCIES: byzanz,gdialog,notify-send (install via sudo add-apt-repository ppa:fossfreedom/byzanz; sudo apt-get update && sudo apt-get install byzanz gdialog notify-osd)
# Time and date
TIME=$(date +"%Y-%m-%d_%H%M%S")
# "Performance Scalability of a Multi-Core Web Server", Nov 2007
# Bryan Veal and Annie Foong, Intel Corporation, Page 4/10
fs.file-max = 5000000
net.core.netdev_max_backlog = 400000
net.core.optmem_max = 10000000
net.core.rmem_default = 10000000
net.core.rmem_max = 10000000
net.core.somaxconn = 100000
net.core.wmem_default = 10000000
net.core.wmem_max = 10000000
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.6.3"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "boot2docker"
config.vm.box = "yungsang/boot2docker"
config.vm.box_check_update = false
@FelikZ
FelikZ / fix_compose.sh
Created April 3, 2018 09:02
Fix docker compose using python pip
#!/bin/bash
pip uninstall docker-py
pip uninstall docker-compose
pip install --upgrade --force-reinstall --no-cache-dir docker-compose
@GaryJones
GaryJones / RedirectsCept.php
Last active May 20, 2019 15:21
Codeception 301 Redirection Tests
<?php
$I = new RedirectsTester($scenario);
$I->wantTo('check 301 redirects are working');
// First, test /login/ page gets rewritten to https://
$I->seePermanentRedirectToHttpsFor('login/');
$I->seePermanentRedirectToHttpsFor('login/?redirect_to=foo');
@stsvilik
stsvilik / gulpfile.js
Last active June 4, 2019 11:24
Gulp browserify, babelify, uglify and concat vendor files
/*! gulpfile.js */
const gulp = require("gulp");
const gutil = require("gulp-util");
const browserify = require("browserify");
const buffer = require("vinyl-buffer");
const uglify = require("gulp-uglify");
const sourcemaps = require("gulp-sourcemaps");
const source = require("vinyl-source-stream");
const concat = require("gulp-concat")

от Али-Бабы и разбойников, к лье под водой и к вархаммеру

Давайте я сразу скажу - речь пойдет о биткоинах. При этом не буду вас агитировать за или против - это вообще не мое дело. Я просто расскажу вам о своем отношении к этому феномену и мифам вокруг него.

Для начала стоит сказать, что я не рассматриваю биткоин как валюту. Это не средство, которое заменит кредитные карты или ежедневные расчеты - для этого есть lightning network и другие средства децентрализации. Для меня биткоин - это актив, максимально похожий на золото во всех его проявлениях, кроме физического присутствия. Биткоины добывают, причем, чем больше биткоинов люди уже добыли, тем сложнее добывать дальше. Количество биткоинов, которые вообще можно будет добыть и пустить в оборот, фиксировано. Обмен биткоинами происходит “из рук в руки”. Хранить биткоины не трудно, затратно только получить или передать их. Замените “биткоины” на “золото” - каждое из этих заявлений так же будет действительно.

Поведение “золотых с

@SimonEast
SimonEast / Acceptance.php
Last active March 11, 2021 15:07
Codeception - how to test for redirects
<?php
// Simply place the following two functions in _support/Helper/Acceptance.php
// Then you can call $I->verifyRedirect(...) inside your tests
namespace Helper;
class Acceptance extends \Codeception\Module
{
/**
* Ensure that a particular URL does NOT contain a 301/302
@ralphtheninja
ralphtheninja / JOBS.md
Last active April 28, 2021 00:38
Use JOBS=max to speed up native node modules

When npm installs native node modules it uses node-gyp to compile code. This is the seam node uses for targeting different operating systems, e.g. OS X, linux, Windows etc.

By default node-gyp compiles using one core and if you have more than one you probably want to utilize that power to speed up compile time. The way node-gyp handles this is by using the JOBS environment variable, which sets the jobs variable here. This piece of code then checks the value of jobs to determine how many cores to use.

Note that if the value of JOBS is max then all cores will be used. So lets try this on leveldown. First lets check that JOBS isn't set yet:

lms@ux301|01:34|~/src/leveldb-repos/leveldown (master) $ echo $JOBS

@ChrisK2
ChrisK2 / How to Vapoursynth + flash3kyuu_db for mpv on Mac OS X.rst
Last active July 19, 2021 09:04
Short tutorial on how to compile Vapoursynth and flash3kyuu_deband on Mac OS X and use it with mpv, might be out of date.