Skip to content

Instantly share code, notes, and snippets.

@yfix
yfix / index.js
Created April 19, 2016 13:08 — forked from cait08/gist:72d4c0c254ce5869cb99
checkboxes mass select with shift key
// Usage: $form.find('input[type="checkbox"]').shiftSelectable();
// replace input[type="checkbox"] with the selector to match your list of checkboxes
$.fn.shiftSelectable = function() {
var lastChecked,
$boxes = this;
$boxes.click(function(evt) {
if(!lastChecked) {
lastChecked = this;
@yfix
yfix / stuns
Created April 5, 2016 09:42 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@yfix
yfix / Install PhantomJS, CasperJS and dependencies.
Created March 28, 2016 10:15 — forked from navio/Install PhantomJS, CasperJS and dependencies.
Script to install NVM, Node, PhantomJS and CasperJS without installing or using git.
#!/bin/bash
# Sets node version to install.
export NODE_VERSION=v0.10.21;
# Verify if nvm installation exist, otherwise install.
if ! hash "nvm" >/dev/null 2>&1; then
printf "Installing NVM %s\n" >&2
@yfix
yfix / php.sh
Created March 1, 2016 12:34
Docker php-cli
#!/bin/bash
docker run --rm -it -v $(pwd):/srv -w /srv yfix/php:7 php "$@"
<?php
/* Usage Example
$save_handler = new MyRedisSessionModule();
$save_handler->save_path = "tcp://127.0.0.1:6379?weight=1";
session_set_save_handler($save_handler, true);
*/
class MyRedisSessionModule implements SessionHandlerInterface {
/**
#!/bin/bash
DOMAIN=www.rohlik.cz
REMOTE="upstream"
BRANCH="production"
REVISION=$(git --git-dir=$SOURCE/.git rev-parse HEAD | cut -c1-7)
GIT_MERGE_AUTHOR=$(git --git-dir=$SOURCE/.git --no-pager show -s --format='%an' $(git --git-dir=$SOURCE/.git rev-parse HEAD))
function json_escape() {
@yfix
yfix / README.md
Created February 4, 2016 09:44 — forked from fprochazka/README.md
Configuring HTTPS + SPDY
<?php
// hack for https proxies
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' && isset($_SERVER['SERVER_PORT']) && in_array($_SERVER['SERVER_PORT'], [80, 82])) { // https over proxy
$_SERVER['HTTPS'] = 'On';
$_SERVER['SERVER_PORT'] = 443;
} elseif ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'http' && isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 80) { // http over proxy
$_SERVER['HTTPS'] = 'Off';
@yfix
yfix / HOWTO
Created January 31, 2016 12:01
speeup composer and npm
http://jackmcdade.com/blog/tired-of-waiting
https://github.com/hirak/prestissimo
https://github.com/alexanderGugel/ied
@yfix
yfix / howto.txt
Created January 28, 2016 12:08
cron weekdays howto
* * * * * выполняемая команда
- - - - -
| | | | |
| | | | ----- День недели (0 - 7) (Воскресенье =0 или =7)
| | | ------- Месяц (1 - 12)
| | --------- День (1 - 31)
| ----------- Час (0 - 23)
------------- Минута (0 - 59)
собственно для дней недели
# каждый рабочий день в 22:00