Skip to content

Instantly share code, notes, and snippets.

Lury lury

Block or report user

Report or block lury

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lury
lury / autopgsqlbackup
Created Jul 20, 2016 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
View autopgsqlbackup
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@lury
lury / create-mysql.bash
Created Jul 15, 2016 — forked from omeinusch/create-mysql.bash
Simple bash script to create mysql db, user with generated password
View create-mysql.bash
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
@lury
lury / install.php
Created Jun 3, 2016 — forked from tschoffelen/install.php
A simple PHP script that automatically downloads and unzips the latest version of Wordpress in the current directory (./), so that I don't have to download it and upload it to my server through FTP manually.
View install.php
<?php
echo '<pre>';
echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL;
// Download file
file_put_contents('wp.zip', file_get_contents('http://wordpress.org/latest.zip'));
$zip = new ZipArchive();
$res = $zip->open('wp.zip');
if ($res === TRUE) {
View gist:dd25270e67f53587e92e
<?php
/**
* Add checkbox field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my-new-field"><h3>'.__('My Checkbox: ').'</h3>';
View spintax.php
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
* @name Spintax
* @author Jason Davis - https://www.codedevelopr.com/
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/
* Modified by Mark Larsen:
* Added ability so that a fixed output can be returned.
*/
class Spintax
@lury
lury / gist:8516520
Created Jan 20, 2014
multilevel delete speed test
View gist:8516520
lury:delete-test user$ time for X in $(seq 1 100);do mkdir -p {1..40}/{1..20}/$X; done
real 0m6.360s
user 0m0.327s
sys 0m2.854s
lury:delete-test user$ time rm -rf *
real 0m23.100s
user 0m0.466s
sys 0m10.035s
@lury
lury / Custom.css
Created Dec 8, 2012 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
View Custom.css
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@lury
lury / ga_reader_scanner.js
Created Oct 26, 2012
GA reader/scanner tracking
View ga_reader_scanner.js
jQuery(function($) {
// Debug flag
var debugMode = true;
// Default time delay before checking location
var callBackTime = 100;
// # px before tracking a reader
var readerLocation = 150;
You can’t perform that action at this time.