Skip to content

Instantly share code, notes, and snippets.

View ravinsharma12345's full-sized avatar

Ravin ravinsharma12345

View GitHub Profile
var http = require("http");
var ASQ = require("asynquence-contrib"); // bring in ASQ + optional contrib plugins
var server = http.createServer();
server.listen(8000);
ASQ.react(function(next){
server.on("request",next);
})
.runner(function*(channel){

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
request = require 'request'
Restzilla = require 'restzilla'
BUGZILLA_URL = 'https://www.w3.org/Bugs/Public/'
BURL = 'http://localhost:8000/AudioWG/MIDI%20API/'
GH_USER = 'jussi-kalliokoski'
GH_REPO = 'webmidi-issues'
GH_URL = 'https://api.github.com/repos/' + GH_USER + '/' + GH_REPO + '/issues'
GH_AUTH =
username: 'octocat'

Multiple PHP version under Ubuntu 13.04

Update your machine

apt-get update
apt-get ugrade

Install some dependencies

apt-get install build-essential

vagrant box add raring-32 http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box
vagrant init raring-32
vagrant up
vagrant ssh
#sudo aptitude install php5-cli php5-dev php-pear imagemagick libmagickwand-dev libmagickcore-dev php5-imagick
#sudo pecl install imagick-beta
@ravinsharma12345
ravinsharma12345 / dompdf.php
Created January 3, 2014 05:41
Getting Started:Dompdf example
require_once get_template_directory().'/dompdf/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$filename = 'massdata_stock_reservation_report_'.date('Y M d').'.pdf';
$filename = sanitize_file_name($filename);
$report_path = get_template_directory().'/'.$filename;
$dompdf->load_html($html);
$dompdf->render();
$pdf = $dompdf->output();
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 2 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'variable_fields_process', 10, 1 );
function variable_fields( $loop, $variation_data ) {
?>
<tr>