Skip to content

Instantly share code, notes, and snippets.

View danidiaz's full-sized avatar

Daniel Díaz Carrete danidiaz

View GitHub Profile
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@aslakknutsen
aslakknutsen / start_testing_java8_today.asciidoc
Last active August 3, 2025 16:31
Example of how to use both JDK 7 and JDK 8 in one build.

JDK 8 Released

Most of us won’t be able to use/deploy JDK 8 in production for a looong time. But that shouldn’t stop us from using it, right?

It should be possible to sneak in JDK 8 in the back way, the same way we snuck in Groovy and other libraries we wanted to use.

The Test Suite to the rescue

The Maven compiler plugin run in two separate lifecycles, compile and testCompile. Those can be configured separately.

@telent
telent / gist:9742059
Last active December 28, 2024 15:25
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
@mroth
mroth / compare.rb
Created March 29, 2014 16:24
Comparison of JSON and MsgPack for typical Emojitracker messages
#!/usr/bin/env ruby
require 'json'
require 'oj'
require 'msgpack'
require 'benchmark'
#################################
# set up sample data
#################################
def hash2array(hash)
@mikaelbr
mikaelbr / destructuring.js
Last active September 5, 2025 11:19
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@danidiaz
danidiaz / do_cnts_install_ghc.sh
Last active August 29, 2015 14:02
Configuring a Digital Ocean VPS (1gb memory, 64 bit CentOS 6.5 image) with the latest GHC for Haskell development. Work in progress.
#! /bin/bash
# http://linuxcommand.org/wss0150.php
function error_exit
{
echo "$1" 1>&2
exit 1
}
# http://unix.stackexchange.com/questions/70859/why-doesnt-sudo-su-in-a-shell-script-run-the-rest-of-the-script-as-root
@staltz
staltz / introrx.md
Last active November 19, 2025 07:55
The introduction to Reactive Programming you've been missing
@danidiaz
danidiaz / dokerx11.sh
Last active October 17, 2015 06:46
Docker & X11 shenanigans
docker run centos yum install -y xorg-x11-xauth xeyes
docker ps -l
docker commit zzzzzzzzzz centos:xeyes
docker run -v $HOME:/hosthome:ro -e XAUTHORITY=/hosthome/.Xauthority -e DISPLAY=$DISPLAY centos cat /hosthome/.Xauthority
docker run -v $HOME:/hosthome:ro -e XAUTHORITY=/hosthome/.Xauthority -e DISPLAY=$(echo $DISPLAY | sed "s/^.*:/$(hostname -i):/") centos:xeyes xeyes
#! /bin/bash
# http://linuxcommand.org/wss0150.php
function error_exit
{
echo "$1" 1>&2
exit 1
}
if [ `whoami` = root ]; then