Skip to content

Instantly share code, notes, and snippets.

View rakauchuk's full-sized avatar
🦄
Champ champ!

Kirill Rakauchuk rakauchuk

🦄
Champ champ!
View GitHub Profile
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#!/bin/bash
for i in `brew list -1`
do
if [[ "$i" == python.* ]] || [[ "$i" == ruby.* ]]
then
continue
fi
brew rm $i && brew install $i
done
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@rakauchuk
rakauchuk / chrome_ajax_1.js
Created January 19, 2015 12:39
handle ajaxComlete in chrome ext (jquery)
var main = function () {
var myEvent = document.createEvent('Event');
myEvent.initEvent('CustomEvent', true, true);
function fireCustomEvent() {
document.body.dispatchEvent(myEvent);
};
jQuery(document).ajaxComplete(function (event, request, settings) {
@rakauchuk
rakauchuk / chrome_ajax_2.js
Created January 19, 2015 12:40
handle ajaxComlete in chrome ext (jquery) v2
var actualCode = '(' + function () {
$(document).ajaxComplete(function () {
console.log('ajaxComplete');
});
} + ')();';
var script = document.createElement('script');
script.textContent = actualCode;
(document.head || document.documentElement).appendChild(script);
@rakauchuk
rakauchuk / gist:0d3b2885df901d1896a9
Created April 25, 2015 12:53
Jenkins Plugins PHP
Checkstyle (for processing PHP_CodeSniffer logfiles in Checkstyle format)
Clover PHP (for processing PHPUnit's Clover XML logfile)
Crap4J (for processing PHPUnit's Crap4J XML logfile)
DRY (for processing phpcpd logfiles in PMD-CPD format)
HTML Publisher (for publishing documentation generated by phpDox, for instance)
echo ip = $(vagrant ssh -c "ip address show eth0 | grep 'inet ' | sed -e 's/^.*inet //' -e 's/\/.*$//'")
@rakauchuk
rakauchuk / gist:45df853f6a4e9ef5172b
Created June 24, 2015 08:32
Dumping MySQL Stored Procedures, Functions and Triggers
MySQL 5 has introduced some new interesting features, like stored procedures and triggers. I will show in this small post how we can backup and restore these components using mysqldump.
mysqldump will backup by default all the triggers but NOT the stored procedures/functions. There are 2 mysqldump parameters that control this behavior:
—routines – FALSE by default
—triggers – TRUE by default
This means that if you want to include in an existing backup script also the triggers and stored procedures you only need to add the —routines command line parameter:
$ mysqldump <other mysqldump options> --routines outputfile.sql
@rakauchuk
rakauchuk / gist:3db172005db0b61f151b
Last active August 29, 2015 14:27
wget as download manager
donwload links:
$ vi links.txt
$ wget -c -i links.txt
download all site:
$ wget -m http://example.com/
site with 5 nodes:
$ wget -c -nc -N -E -r -l 5 -k -p -np http://example.com/catalogue/bla-bla-bla
@rakauchuk
rakauchuk / README.md
Created October 19, 2015 07:42
Use self git-fork in composer

"behat/behat" is the original library and "dev-fork" is the branch is needed. "rakauchuk/Behat" is a fork of "dev-master" branch. "composer update" should get the modified version of "behat/behat"