Skip to content

Instantly share code, notes, and snippets.

View mikaelz's full-sized avatar

Michal Zuber mikaelz

View GitHub Profile
@mikaelz
mikaelz / javascript_loader.js
Last active September 27, 2015 15:19 — forked from hagenburger/javascript_loader.js
Dynamically load JavaScript files with callback when finished
// Example:
Loader.load("/script/main.js");
Loader.load(base_url + '/include/fancybox2/jquery.fancybox.pack.js', function() {
$('.fancybox').fancybox();
});
var Loader = {
load: function(src, callback) {
var script = document.createElement('script'),
@mikaelz
mikaelz / README
Last active December 8, 2022 22:18 — forked from johntyree/soundcloud
Fill MPC/MPD playlist with SoundCloud stream URLs
Options:
soundcloud.py --genre
soundcloud.py search
soundcloud.py user
soundcloud.py tracks
soundcloud.py url
soundcloud.py playlist
Usage:
@mikaelz
mikaelz / notify.sh
Created February 11, 2014 05:48 — forked from jehiah/notify.sh
#!/bin/bash
#
# *************************************************
# chkconfig: 2345 99 99
# description: notify email address on system boot.
# *************************************************
# Installing:
# 1) save as /etc/rc.d/init.d/notify
# 2) set the desired email address in "MAILADD" variable
# 3) chmod a+w /etc/rc.d/init.d/notify
@mikaelz
mikaelz / php-compile.sh
Last active December 17, 2015 21:38 — forked from JeffreyWay/gist:3185773
configure for php compile
// http://kubyshkin.ru/posts/installing-php-xdebug-extension-on-mac-os-x-10-7-lion.html
MACOSX_DEPLOYMENT_TARGET=10.7
CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
./configure \
--prefix=/usr \
<?php
/*
Plugin Name: R Debug
Description: Set of helper dump functions for debug.
Author: Andrey "Rarst" Savchenko
Author URI: http://www.rarst.net/
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
<?php
$pdo = new PDO("mysql:host=HOSTNAME", "USERNAME", "PASSWORD");
$query = $pdo->prepare("SHOW DATABASES");
$query->execute();
foreach ($query->fetchAll(PDO::FETCH_OBJ) as $row) {
$db = $row->Database;
echo "= $db =" . PHP_EOL;
$pdo->exec("USE $db");