Skip to content

Instantly share code, notes, and snippets.

@nlinker
nlinker / sbt.xml
Created February 7, 2014 12:32 — forked from ambantis/sbt.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ScalaSbtSettings">
<option name="linkedExternalProjectsSettings">
<SbtProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="useAutoImport" value="true" />
</SbtProjectSettings>
</option>
</component>

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@nlinker
nlinker / AA.md
Created June 10, 2014 13:28 — forked from sadache/AA.md

Is socket.push(bytes) all you need to program Realtime Web apps?

One of the goals of Play2 architecture is to provide a programming model for what is called Realtime Web Applications.

Realtime Web Applications

Realtime Web Applications are applications that make use of Websockets, Server Sent Events, Comet or other protocols offering/simulating an open socket between the browser and the server for continuous communication. Basically, these applications let users work with information as it is published - without having to periodically ping the service.

There are quite a few web frameworks that target the development of this type of application: but usually the solution is to simply provide an API that allows developers to push/receive messages from/to an open channel, something like:

import Stream._
/** A possibly finite stream that repeatedly applies a given function to a start value.
*
* @param start the start value of the stream
* @param f the function that's repeatedly applied
* @return the stream returning the possibly finite sequence of values `start, f(start), f(f(start)), ...`
*/
def iterate[A](f: A => A, a: A): Stream[A] = unfold((x: A) => Some((x, f(x))), a)
/*
* OpenSimplex (Simplectic) Noise in Java.
* (v1.0.1 With new gradient set and corresponding normalization factor, 9/19/14)
*/
public class OpenSimplexNoise {
private static final double STRETCH_CONSTANT_3D = -1.0 / 6;
private static final double SQUISH_CONSTANT_3D = 1.0 / 3;
#![feature(phase)]
#[phase(plugin, link)] extern crate log;
extern crate green;
extern crate rustuv;
use std::io;
use std::os;
use std::io::{Listener,Acceptor,TcpStream};
#[start]
trait Isomorphism[A, B] {
def fw: A => B
def bw: B => A
}
object Isomorphism {
implicit def anyIso[A](a: A) = new {
def as[B](implicit ev: Isomorphism[A, B]) = ev fw a
}
import scala.language.implicitConversions
/**
* @author gwenzek
*
*/
class ArgsOps(ops: Map[String, OptionalParam], val args: Array[String]){
def apply(op: String) = ops(op)
}
@nlinker
nlinker / install-ghc.md
Last active August 29, 2015 14:25 — forked from yantonov/install-ghc-ubuntu.md
how to install latest GHC 7.10.1 + cabal 1.22.3.0 from source on ubuntu

How to install latest GHC 7.10.1 + cabal 1.22.3.0 from source on ubuntu

for your convinience these instuction is available as:
gist
git repo

ghc

ubuntu prerequisites

@nlinker
nlinker / example.sh
Last active August 29, 2015 14:26 — forked from tristanbes/example.sh
Install Graphite on Debian Server
# Installing graphite dependencies
apt-get install -y python2.6 python-pip python-cairo python-django python-django-tagging
apt-get install -y libapache2-mod-wsgi python-twisted python-memcache python-pysqlite2 python-simplejson
pip install whisper
pip install carbon
pip install graphite-web
# Setup a vhost by grabbing the example the graphite team released on their repo.
# In this file, you'll provide the url used to access to your Graphite dashboard
wget https://raw.github.com/tmm1/graphite/master/examples/example-graphite-vhost.conf -O /etc/apache2/sites-available/graphite