Skip to content

Instantly share code, notes, and snippets.

Cristobal Dabed cristobal

Block or report user

Report or block cristobal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View location.conf
location /gdpr/mobile/webview {
# proxy_pass https://static.nrksuper.no;
# proxy_pass http://localhost:80;
proxy_cache CACHE;
proxy_cache_valid 200 10m;
proxy_cache_revalidate on;
# proxy_cache_min_uses 3;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_cache_background_update on;
@cristobal
cristobal / index.html
Last active Jun 8, 2017
Ludo Mediasync Test Example
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://static.nrk.no/core-fonts/latest/core-fonts.min.css">
<link rel="stylesheet" href="https://static.nrk.no/core-css/latest/core-css.min.css">
<title>Ludo Timing Example</title>
<style>
h3 {
padding: 10px 0 0 10px;
@cristobal
cristobal / AbstractError.js
Last active Dec 14, 2016
AbstractError + CustomError
View AbstractError.js
// @see https://github.com/bjyoungblood/es6-error
// @see http://dailyjs.com/2014/01/30/exception-error/
import {map} from 'lodash';
const defineProperty = (obj, prop, value) => {
Object.defineProperty(obj, prop, {
configurable: true,
enumerable: false,
value
});
@cristobal
cristobal / reduce-promises-over-x.js
Created Sep 1, 2016
Reduce a set of promises (S) over a a value x
View reduce-promises-over-x.js
const reducePromises = (S, x) =>
S.reduce((f, g) => f.then(g), Promise.resolve(x));
View keybase.md

Keybase proof

I hereby claim:

  • I am cristobal on github.
  • I am cristobal (https://keybase.io/cristobal) on keybase.
  • I have a public key ASAs5cvXRdcF-ajmMlIOsVqdbEkEVN0SUSEyZUPhWZ0OAgo

To claim this, I am signing this object:

@cristobal
cristobal / # mosml - 2016-03-19_16-50-37.txt
Created Mar 19, 2016
mosml on OS X 10.11.3 - Homebrew build logs
View # mosml - 2016-03-19_16-50-37.txt
Homebrew build logs for mosml on OS X 10.11.3
Build date: 2016-03-19 16:50:37
@cristobal
cristobal / machine-diskutil.sh
Last active Feb 12, 2019
Machine Diskutil to mount/unmont external volumes inside docker machines running on Virtualbox
View machine-diskutil.sh
#!/usr/bin/env sh
# @see http://stackoverflow.com/questions/30040708/how-to-mount-local-volumes-in-docker-machine
# @see https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md
################################################################################
# Dependency Section #
# #
################################################################################
check_deps() {
## Make sure commands are available
@cristobal
cristobal / propel_session_config.php
Created Apr 20, 2015
Silex - Propel + Session in DB
View propel_session_config.php
<?php
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
use Propel\Runtime\Propel;
use Propel\Runtime\Connection\ConnectionWrapper;
use Propel\Runtime\Connection\PdoConnection;
use Propel\Silex\PropelServiceProvider;
//--------------------------------------
@cristobal
cristobal / sort_asc.js
Last active Aug 29, 2015
Insertion Sort
View sort_asc.js
function sort_asc(values) {
var n = values.length;
for (var i = 1; i < n; i++) {
var v = values[i];
var k = i - 1;
while (k >= 1 && v > values[k]) {
values[k + 1] = values[i];
k = k - 1;
}
@cristobal
cristobal / notin.py
Created Oct 15, 2014
Diff lines from file a and b, all lines from b that are not in a will be displayed
View notin.py
#!/usr/bin/env python
import sys
def get_tokens(src):
file = open(src)
return [token.strip(' \t\n\r') for token in file.readlines()]
def diff_tokens(a, b):
return [x for x in a if x not in b]
You can’t perform that action at this time.