Skip to content

Instantly share code, notes, and snippets.

View svnlto's full-sized avatar
🦙

Sven Lito svnlto

🦙
View GitHub Profile
@svnlto
svnlto / 00-docker-registry-setup.md
Last active December 9, 2022 04:51 — forked from devpkiconix/00-docker-registry-setup.md
Docker registry setup on boot2docker

After this setup, all the images pushed to the registry will be available in ~/registry/data directory.

Steps:

  1. Install boot2docker. this will be our registry server
  2. Run boot2docker. This should mount user folder from host (e.g. /Users-> /Users). We will host the registry files in this tree, at: ~/registry/data
  3. Save its IP address, REGISTRY_HOST=$(boot2docker ip)
  4. Run registry. Note that this must be executed on the host machine for the shell to interpret ~ correctly.
@svnlto
svnlto / handlebars.js
Created November 15, 2011 13:56 — forked from phiggins42/handlebars.js
dojo handlebars.js
dojo.provide("dbp._Handlebars");
dojo.require("dijit._TemplatedMixin");
(function(d) {
// lib/handlebars/parser.js
/* Jison generated parser */
var handlebars = (function(){
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"param":27,"STRING":28,"INTEGER":29,"BOOLEAN":30,"hashSegments":31,"hashSegment":32,"ID":33,"EQUALS":34,"pathSegments":35,"SEP":36,"$accept":0,"$end":1},
@svnlto
svnlto / gist:1491562
Created December 17, 2011 22:10 — forked from ryanrolds/gist:1491554
svnlto
function request(callback) {
var http, options;
http = require("http");
options = {
host: "api.outofme.de",
port: 80,
path: "/graphics",
method: "GET"
};
dojo.provide(" myshit.external._Mustache");
dojo.require("dijit._Templated");
(function(d){
/*
mustache.js — Logic-less templates in JavaScript
See http://mustache.github.com/ for more info.
*/
@svnlto
svnlto / README.md
Created November 28, 2011 00:17 — forked from bergie/README.md
Falsy Values tutorials
@svnlto
svnlto / README.md
Created February 18, 2016 13:40 — forked from yang-wei/README.md
ES6 destructing (and rest parameter)

We will first discussed how destructing and rest parameters can be used in ES6 - in arrays and objects. Then we will look at a few examples and also discuss some quiz.

arrays

var array = [1, 2, 3, 4];
var nestedArray = [1, 2, 3, 4, [7, 8, 9]];

var [a, b, c, d] = array;
console.log(a, b, c, d)
'use strict';
var React = require('react/addons');
var PureRenderMixin = React.addons.PureRenderMixin;
var MAX_LOADING_TASKS = 3;
var loadingQueue = [];
var loadingQueueDirty = false;
var loadingTasks = 0;
@svnlto
svnlto / feathersjs-dataloader.js
Created July 24, 2017 18:00 — forked from giautm/feathersjs-dataloader.js
Use facebook's dataloader to batch any Service get
'use strict';
const DataLoader = require('dataloader');
class Service {
constructor({ BaseService, options }) {
this.id = BaseService.id || 'id';
this.service = BaseService;
this.dataloader = new DataLoader(this._batchGet.bind(this), options);
@svnlto
svnlto / webhooks-with-hapi.js
Created August 27, 2016 10:19
Webhook receiver with hapi.js
/*
Webhook receivers should accept a request and immediately respond with HTTP 204 No Content before processing the request. Here's how to do this with hapi.js.
Start this server:
`node webhooks-with-hapi.js`
Then make a request:
`curl http://localhost:8000/webhook-receiver -v`
Note the correct behavior: HTTP response will be sent and connection closed before the webhook processing starts.