Skip to content

Instantly share code, notes, and snippets.

View tutysara's full-sized avatar

tutysara tutysara

View GitHub Profile
@tutysara
tutysara / bash_prompt.sh
Last active April 22, 2018 21:56 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@tutysara
tutysara / bash_prompt.sh
Created April 22, 2018 21:45 — forked from romanlevin/bash_prompt.sh
Set color bash prompt according to active pyenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
(defun sublime-text-2 ()
(interactive)
(color-theme-install
'(sublime-text-2
((background-color . "#171717")
(background-mode . light)
(border-color . "#1a1a1a")
(cursor-color . "#fce94f")
(foreground-color . "#cfbfad")
(mouse-color . "black"))
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################
@tutysara
tutysara / gist:3218266
Created July 31, 2012 16:29 — forked from swannodette/gist:3217582
sudoku_compact.clj
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [grid x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in grid [x y])))
(defn init [grid [pos value]]
@tutysara
tutysara / install-jdee.sh
Created July 12, 2012 17:33 — forked from lowstz/install-jdee.sh
A simple script to install JDE for Emacs (JDEE)
#!/bin/sh
# Change `ELISP_DIR` variable as you needed
ELISP_DIR="$HOME/.emacs.d/site-lisp"
MIRROR="https://lowstz.org/jdee"
echo -n "This script require wget and unzip, please ensure that your system has been installed them?[yes/no]:"
read choice
case $choice in
YES|yes|Y|y)
@tutysara
tutysara / MerjSawt.clj
Created March 21, 2012 17:58 — forked from christianblunden/MerjSawt.clj
TCO optimised Clojure implementation of Merge Sort
(ns merge_sort.core
(:use [clojure.java.io :only (reader)])
(:gen-class :main true))
(defn merj [left right]
(loop [[lhead & ltail :as left] left
[rhead & rtail :as right] right
result []]
(cond (nil? left) (concat result right)
(nil? right) (concat result left)