Skip to content

Instantly share code, notes, and snippets.

;;; my solution
(define (min a b)
(if (< a b) a b))
(define (min3 a b c)
(min a (min b c)))
(define (square x)(* x x))
@lamida
lamida / .bowerrc
Last active August 29, 2015 14:02
{
"directory": "public/lib",
"proxy":"http://<proxy>",
"https-proxy":"http://<proxy>"
}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
</project>
@lamida
lamida / gist:8a949caea73dbaad16c7
Last active August 29, 2015 14:04
array-permutation.c
#include <stdio.h>
#include <stdlib.h>
void swap(int *a, int *b)
{
//printf("%p %p\n", a, b);
//printf("%d %d\n", *a, *b);
int tmp = *a;
*a = *b;
*b = tmp;
public class Permut {
public static void main(String[] args) {
int ar[] = { 1, 2, 3};
permut(ar, 0);
}
public static void print(int[] ar){
for(int i = 0; i < ar.length; i++){
System.out.printf("%d ", ar[i]);
}
@lamida
lamida / Sorting.java
Last active August 29, 2015 14:05
Sorting.java
public class MainSort {
public void print(int[] ar){
for(int a : ar){
System.out.print(a + " ");
}
System.out.println();
}
public void swap(int[] ar, int a, int b){
int temp = ar[b];
public class Permut {
public void print(int[] ar){
for(int a : ar){
System.out.print(a + " ");
}
System.out.println();
}
public void swap(int[] ar, int a, int b){
package controllers
import play.api._
import play.api.mvc._
object Application extends Controller with LoggerSupport {
def index = Action { implicit req =>
logger.info(s"Serving index to ${req.remoteAddress}")
Ok(views.html.index())
}
@lamida
lamida / gist:d92c9399a4300ee2e105
Last active August 29, 2015 14:21
.tmux.conf
set -g prefix C-a
bind C-a send-prefix
setw -g mode-keys vi
set -g mode-mouse on
set-window-option -g xterm-keys on
set-option -g renumber-windows on
#######################################################
# TPM BEGIN
#######################################################
@lamida
lamida / env
Last active December 20, 2015 10:49
export JAVA_HOME=/opt/jdk-current
export GOROOT=/opt/go
export PATH=$PATH:/opt/jdk-current/bin
export PATH=$PATH:/opt/apache-maven-current/bin
export PATH=$PATH:/opt/scala-current/bin
export PATH=$PATH:/opt/clojure-current
export PATH=$PATH:/opt/go/bin
export PATH=$PATH:/opt/sbt/bin
export PATH=$PATH:/opt/mongodb-current/bin
export PATH=$PATH:/opt/hadoop-current/bin