This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance | |
# Also requires postgresql client tools http://www.postgresql.org/download/linux/ubuntu/ | |
# Run chmod +x to make this file executable then run it: ./docker_create_treeio.sh | |
# Author: Adam Awan | |
# Email: [email protected] | |
# Set the port to forward for Tree.io | |
TREEIO_PORT="80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
mkdir -p /usr/share/zoneinfo /data | |
chown default /data | |
if [ $# -eq 1 ] | |
then | |
echo $1 > /pwfile | |
else | |
head -c 16 /dev/urandom | sha1sum | cut -c1-10 > /pwfile | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns crash-course-clojure.github | |
(:require [clj-http.client :as http] | |
[cheshire.core :refer [parse-string]] | |
[clojure.pprint :refer [pprint]])) | |
(defn query-github | |
"Run an arbitrary query agains Github's API." | |
[query] | |
(parse-string (:body (http/get "https://api.github.com/users/funkotron/repos" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns crash-course-clojure.github | |
(:require [clj-http.client :as http] | |
[cheshire.core :refer [parse-string]] | |
[clojure.pprint :refer [pprint]])) | |
(defn query-github | |
"Run an arbitrary query agains Github's API." | |
[query] | |
(parse-string (:body (http/get "https://api.github.com/users/funkotron/repos" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout somewhen, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Set up external monitor if connected | |
EXTERNAL=`xrandr | grep -i "HDMI1 disconnected"` | |
if [ -z $EXTERNAL ]; then | |
xrandr --output HDMI1 --auto --left-of eDP1 | |
fi | |
sleep 1 | |
#Set up main monitor | |
xrandr --output eDP1 --auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
Dir="/home/a/Dropbox/wallpaper" | |
if [ ! -d "$Dir" ]; then | |
echo "Not Exist $Dir" | |
exit 1 | |
fi | |
SetBG () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn palindrome? | |
"Is x the same read backwards?" | |
[x] | |
(let [s (seq (str x))] | |
(= s (reverse s)))) | |
(def three-digit-products | |
"All the products of two three-digit numbers" | |
(for [x (range 100 999) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns jam.all-your-base | |
(:require [clojure.math.numeric-tower :as math])) | |
(def in (rest (clojure.string/split (slurp "A-large-practice.in") #"\n"))) | |
(defn p [x y] | |
(math/expt x y)) | |
(defn next-index [x] | |
(cond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
def distinct(j): | |
seen = set() | |
for i in j: | |
if i not in seen: | |
seen.add(i) | |
return seen | |
def next_index(c): |
OlderNewer