Skip to content

Instantly share code, notes, and snippets.

View kidager's full-sized avatar
🎧
¯\_(ツ)_/¯

Jacem Chaieb kidager

🎧
¯\_(ツ)_/¯
View GitHub Profile
@kidager
kidager / mongo-docker.bash
Created January 16, 2019 09:57 — forked from davideicardi/mongo-docker.bash
Running mongodb inside a docker container (with mongodb authentication)
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is https://hub.docker.com/_/mongo/
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception)
# add a root user
@kidager
kidager / codeigniter-apache-hhvm.md
Created February 1, 2016 15:46 — forked from shivaas/codeigniter-apache-hhvm.md
CodeIgniter with Apache & HHVM as FastCGI

Apache Configuration:

<VirtualHost *:80>
  ServerName blah.com

  DirectoryIndex index.html index.php
  ProxyRequests On
  ProxyPreserveHost On
  ProxyVia full
@kidager
kidager / xhr.promise.js
Last active August 29, 2015 14:18 — forked from matthewp/gist:3099268
Asynchronous request using promises
function xhr(options) {
var deferred = Q.defer(),
req = new XMLHttpRequest();
req.open(options.method || 'GET', options.url, true);
// Set request headers if provided.
Object.keys(options.headers || {}).forEach(function (key) {
req.setRequestHeader(key, options.headers[key]);
});