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
n=int(input("base")) | |
def triangle(n): | |
y=((n+(n-1))/2) | |
x=1 | |
while (x <= n): | |
if x%2==0: | |
print(" "*(y+1)+"* "*(x-1)+"*") | |
x=x+1 | |
y=y-1 |
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 brainfart.core) | |
(defn- inc-at | |
[tape ptr] | |
(update-in tape [ptr] #(+ % (byte 1)))) | |
(defn- dec-at | |
[tape ptr] | |
(update-in tape [ptr] #(- % (byte 1)))) |
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
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' | |
Bundle 'chrisbra/NrrwRgn' |
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- scale-value | |
"Linearly transforms x from range input-range to output-range where: | |
input-range - a vector like [min max] | |
output-range - a vector like [min max] | |
" | |
[x input-range output-range] | |
(let [[a b] input-range | |
[c d] output-range] |
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 permutations [elements] | |
(if-let [xs (seq elements)] | |
(for [x xs | |
permutation (permutations (remove #{x} xs))] | |
(conj permutation x)) | |
[[]])) |
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
function isLoggedIn() { | |
var deferred = $q.defer(); | |
Facebook.getLoginStatus().then(function(loginStatus) { | |
if (!loginStatus.loggedIn) { | |
resolve(deferred, false); | |
} else { |
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
python -m this | awk 'NR>=3&&NR<=9' | awk -F " " '{t=$1;$1=$NF;$NF=t}1' | awk '{print tolower($0)}' | sed -e 's/\([[:punct:]]\)//g' | awk '{print toupper(substr($0,1,1))""substr($0,2)}' |
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
silent %y | new | silent pu | %!grep db ^@ %!column -t |
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
First tune the bottom E. string to a tuning fork or tuning machine. Next, fret the E. string at the tenth fret. This will give you a D. Tune the D. string to this note by ear. Next, fret the D. string at the fifth fret. Tune the G. string to the D. string at the fifth fret. Now fret the G. string at the second fret. This gives you an A. Tune the A. string from this note. Now fret the A. string at the second fret. Tune the B. string from this note. It will be an octave up. Next, fret the D. string at the second fret. This gives you E. Tune your high E from this. Again this will be an octave. |
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
import time | |
import subprocess | |
import re | |
start_time = int(time.time()) | |
cmd = ['amixer', 'get', 'Master'] | |
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
NewerOlder