Skip to content

Instantly share code, notes, and snippets.

View mkdizajn's full-sized avatar
🐢
slow & thorough > faster & mistakable

Kresimir Pendic mkdizajn

🐢
slow & thorough > faster & mistakable
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@mikejolley
mikejolley / gist:1547491
Created January 1, 2012 14:38
WooCommerce - A filter to add a tracking (or any other field for that matter) to order emails to customers.
/* To use:
1. Add this snippet to your theme's functions.php file
2. Change the meta key names in the snippet
3. Create a custom field in the order post - e.g. key = "Tracking Code" value = abcdefg
4. When next updating the status, or during any other event which emails the user, they will see this field in their email
*/
add_filter('woocommerce_email_order_meta_keys', 'my_custom_order_meta_keys');
function my_custom_order_meta_keys( $keys ) {
$keys[] = 'Tracking Code'; // This will look for a custom field called 'Tracking Code' and add it to emails
@alotaiba
alotaiba / google_text2speech.md
Created February 3, 2012 07:31
Google Text to Speech API

Google Text to Speech API

Base URL: http://translate.google.com/translate_tts
It converts written words into audio. It accepts GET requests.

GET

q
The query string to convert to audio

tl
Translation language, for example, ar for Arabic, or en-us for English

@christophermanning
christophermanning / README.md
Last active March 30, 2023 04:24
Voronoi Diagram with Force Directed Nodes and Delaunay Links

Created by Christopher Manning

Summary

Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.

The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.

Controls

@aeurielesn
aeurielesn / gist:2511005
Created April 27, 2012 17:23
Retrying a jQuery.ajax() call
$.ajax({
url: '/echo/error/',
async: true,
// retryCount and retryLimit will let you retry a determined number of times
retryCount: 0,
retryLimit: 10,
// retryTimeout limits the total time retrying (in milliseconds)
retryTimeout: 10000,
// timeout for each request
timeout: 1000,
@brankoajzele
brankoajzele / gist:2781404
Created May 24, 2012 12:56
Programatically create Magento order with tablerate shipping
<?php
require_once 'app/Mage.php';
Mage::app();
$quote = Mage::getModel('sales/quote')
->setStoreId(Mage::app()->getStore('default')->getId());
$product = Mage::getModel('catalog/product')->load(6); /* 6 => Some product ID */
@jrfnl
jrfnl / wp-config-debug.php
Last active April 5, 2024 18:16
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*
@Rich-Harris
Rich-Harris / gh-pages.md
Created August 11, 2013 23:02
Automating gh-pages branch updating with changes to the master branch
@robschmuecker
robschmuecker / README.md
Last active April 24, 2024 14:12
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.