Skip to content

Instantly share code, notes, and snippets.

@CraZySacX
CraZySacX / max.scala
Last active August 29, 2015 14:00
I think an anon function would work, but can't seem to find the proper syntax...
// Original....
def max(xs: List[Int]): Int = {
def findMax(curr: Int, l: List[Int]): Int = {
if (l.isEmpty)
curr
else if (l.head > curr)
findMax(l.head, l.tail)
else
findMax(curr, l.tail)
}
@CraZySacX
CraZySacX / git.clj
Last active November 24, 2020 19:23
Clojure git wrapper
(ns org.ozias.git
(:require [me.raynes.conch :refer (with-programs)]))
(def ^:private git-porcelain
["add" "am" "bisect" "branch" "bundle" "checkout" "cherry-pick" "citool"
"clean" "clone" "commit" "describe" "diff" "fetch" "format-patch"
"gc" "grep" "gui" "init" "log" "merge" "mv" "notes" "pull" "push"
"rebase" "reset" "revert" "rm" "shortlog" "show" "stash" "status"
"submodule" "tag"])
@CraZySacX
CraZySacX / merger.py
Created February 19, 2014 14:24
Python script that aids with merging upstream projects with origin. Useful for github forks.
#!/usr/bin/python3
import argparse
import os
from os import environ
from subprocess import check_call
# Store the current directory
owd = os.getcwd()
# Setup the supported command-line arguments
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE: