Skip to content

Instantly share code, notes, and snippets.

View drzippie's full-sized avatar
👁️‍🗨️

Antonio Cortes (DrZippie) drzippie

👁️‍🗨️
View GitHub Profile
@drzippie
drzippie / PHP_excel_maker.php
Created December 17, 2013 21:04
Basic Excel Generator PHP
<?php
/**
* Basic Excel Generator
*
* Usage:
$data = array(
array( 'cell_1_1', 'cell_1_2'),
array( 'cell_2_1', 'cell_2_2')
);
$excel = new ExcelMaker( $data ) ;
@drzippie
drzippie / functions_wordpress_jquery.coffee
Created December 17, 2013 21:08
Coffeescript for Wordpress and jQuery
jQuery(document).ready ($) ->
alert "Hello World!"
return
@drzippie
drzippie / Settings.php
Created December 17, 2013 21:11
Settings: Key => value as Singleton
<?php
class Settings {
var $values;
final public static function getInstance() {
static $aoInstance = null;
if (is_null($aoInstance)) {
$aoInstance = new Settings();
}
return $aoInstance;
@drzippie
drzippie / jquery_plugin.coffee
Created December 25, 2013 10:44
Coffeescript - Create a jQuery Plugin
# Reference jQuery
$ = jQuery
# Adds plugin object to jQuery
$.fn.extend
# Change pluginName to your plugin's name.
pluginName: (options) ->
# Default settings
settings =
option1: true
@drzippie
drzippie / check_is_running.sh
Created December 30, 2013 16:57
Check shellscript - check is running
#!/bin/bash
#
lockdir=/tmp/diario_stocks.lock
if mkdir "$lockdir"
then
echo >&2 "successfully acquired lock"
# Remove lockdir when the script finishes, or when it receives a signal
trap 'rm -rf "$lockdir"' 0 # remove directory when script finishes
@drzippie
drzippie / theme-my-login-template-files.txt
Created January 23, 2014 18:23
theme-my-login template files
# templates/
user-panel.php
resetpass-form.php
register-form.php
profile-form.php
ms-signup-user-form.php
ms-signup-blog-form.php
ms-signup-another-blog-form.php
lostpassword-form.php
@drzippie
drzippie / theme-my-login-custom.php
Created January 23, 2014 18:26
theme-my-login-custom.php with custom template dir
<?php
/**
* theme-my-login-custom.php
*/
/**
* Cambiamos las plantillas por unas propias
* @param string $useTemplate Plantilla encontrada
* @param array $templates Plantillas buscadas
@drzippie
drzippie / gist:30c37456ad1305997186
Created January 20, 2015 15:51
Publisher - Dependence and hierarchy of nodes to publish.php
<?php
$nodes = [
'1' => ['50'],
'2' => ['21','53', '14'],
'21' => ['53', '10', '15'] ,
'10' => ['14', '1'],
'14' => [],
'15' => ['21'],
'53' => [ '14'] ,
@drzippie
drzippie / compress_images.sh
Created January 31, 2015 11:55
compress images
find . -type f -size +150k -name '*-original.jpeg' -exec mogrify -verbose -strip -resize 1024x1024">" -quality 80 -define jpeg:extent=140kb. {} \;
package main
import (
"crypto/hmac"
"crypto/md5"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
)