Skip to content

Instantly share code, notes, and snippets.

View webholics's full-sized avatar

Mario Volke webholics

View GitHub Profile
@webholics
webholics / 20130805155341_ContactTemplate.php
Created August 9, 2013 07:29
Processwire + phpmig - This gist shows how to use the concept of migrations with the phpmig library in Processwire to enable versioning of template and field structure and to enable collaboration in Processwire projects.
<?php
use Phpmig\Migration\Migration;
class ContactTemplate extends Migration
{
/**
* Do the migration
*/
public function up()
var urlToResolve = 'https://localhost/';
var https = require('https'),
url = require('url');
var parsedUrl = url.parse(urlToResolve);
var path = parsedUrl.pathname;
var options = {
host: parsedUrl.hostname,
path: path,
var urlToResolve = 'https://github.com/kriskowal/tigerblood/';
var https = require('https'),
url = require('url'),
jsdom = require('jsdom');
var parsedUrl = url.parse(urlToResolve);
var path = parsedUrl.pathname;
var options = {
host: parsedUrl.hostname,
@webholics
webholics / Barrier flow control for NodeJS
Created February 18, 2011 08:49
The barrier can be used to control concurrent flows in NodeJS. It counts how often the function returned is called and executes the callback if it has been called "count" times.
/*
* A barrier that counts how often a function is called.
*/
module.exports = function(count, callback) {
var c = count;
// if count is 0 execute callback
if(c == 0)
callback();