Skip to content

Instantly share code, notes, and snippets.

View nick2474's full-sized avatar

Didierh nick2474

View GitHub Profile
@Cacodaimon
Cacodaimon / ChatClient.js
Created November 23, 2012 14:43
Used @ cacodaemon.de
module.exports.ChatClient = function () {
if (module.exports.ChatClient.instance) {
return module.exports.ChatClient.instance;
}
module.exports.ChatClient.instance = this;
this.host = null;
this.welcomeTime = 0;
var interval = null;
@natelandau
natelandau / .bash_profile
Last active June 13, 2024 18:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@denzildoyle
denzildoyle / Ionic Notes.md
Last active September 19, 2017 13:37
Ionic notes: How to get started with Ionic mobile application development framework.

##Getting Started with Ionic Framework

Ionic is a powerful, beautiful and easy to use open source front-end framework built on top of AngularJs (a client-side javascript framework), Sass Syntactically Awesome Style Sheets Apache Cordova for and developing hybrid (cross platform) mobile apps.

Ionic's ultimate goal is to make it easier to develop native mobile apps with HTML5, also known as Hybrid apps.

Install nodejs: http://nodejs.org/

    npm install -g cordova ionic
@miromasat
miromasat / emulate.sh
Created October 31, 2014 15:34
This was an only solution for debugging Ionic apps for me.
#!/bin/bash
# Manually emulate ionic/cordova application
# Miroslav Masat 2014
echo "Emulating..."
cd ./platforms/ios/build/emulator
var=$(pwd)
ios-sim launch "$var"/*.app
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active May 7, 2024 13:07
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
@stormwild
stormwild / woocommerce-create-order.md
Last active November 5, 2023 01:40
WooCommerce Creating Order Programmatically

WooCommerce Creating Order Programmatically

WooCommerce Create Order

creating Woocommerce order with line_item programatically

// http://stackoverflow.com/questions/26581467/creating-woocommerce-order-with-line-item-programatically
$address = array(
            'first_name' => 'Fresher',
@romuald
romuald / processlist.sql
Last active April 16, 2024 20:15
Show PostgreSQL current (running) process list;
SELECT user, pid, client_addr, waiting, query, query_start, NOW() - query_start AS elapsed
FROM pg_stat_activity
WHERE query != '<IDLE>'
-- AND EXTRACT(EPOCH FROM (NOW() - query_start)) > 1
ORDER BY elapsed DESC;
/**
* @Title: Woocommerce Add a product to the cart programmatically
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
* @Blog URL: http://minapansuriya.com/woocommerce-add-a-product-to-the-cart-programmatically/
*/
add_action( 'template_redirect', 'pbs_woo_add_gift_product_to_the_cart' );
function pbs_woo_add_gift_product_to_the_cart() {
$isAddGiftF = false;
@corsonr
corsonr / create-woocommerce-order-dynamically.php
Created April 4, 2017 10:03
Create a WooCommerce Order Dynamically
<?php
/*
* Create order dynamically
*/
add_action( 'woocommerce_before_checkout_form', 'create_order' );
function create_order() {
global $woocommerce;