This file contains hidden or 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
| def flatten(arr): | |
| resp = [] | |
| for i in arr: | |
| if type(i) == list: | |
| temp = flatten(i) | |
| resp.extend(temp) | |
| else: | |
| resp.append(i) | |
| return resp |
This file contains hidden or 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 | |
| # sets stdin to no echo and give a char every tenth of a sec. | |
| # found on the internet, I don't claim ownership. | |
| # http://www.thelinuxdaily.com/2012/03/simple-stopwatch-script/ | |
| stty -echo -icanon time 1 <&0 | |
| chkspace () { | |
| if ! read -t 0 ; then return 1 ; fi # no char pressed |
This file contains hidden or 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
| /* | |
| * liblist.c | |
| * A simple list library that implements Queue and Stack behavior | |
| */ | |
| #include <stdlib.h> | |
| struct Node { | |
| void *value; | |
| struct Node *next; | |
| struct Node *previous; |
This file contains hidden or 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
| execute pathogen#infect() | |
| syntax on | |
| set smartindent | |
| colorscheme monochrome | |
| autocmd FileType html setlocal smartindent expandtab shiftwidth=2 tabstop=2 | |
| autocmd FileType yaml setlocal smartindent expandtab shiftwidth=2 tabstop=2 | |
| autocmd FileType javascript setlocal smartindent expandtab shiftwidth=4 tabstop=4 |
This file contains hidden or 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 | |
| dev0=eth0 | |
| vpnconf="forticlient" | |
| nameserver="8.8.4.4" | |
| runfile="/var/run/vpnc.pid" | |
| if [ $(id -u) != "0" ] | |
| then | |
| echo "Must be run as root" >&2 |
This file contains hidden or 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
| #include <stdlib.h> | |
| #include "queue.h" | |
| static struct Node { | |
| void *value; | |
| struct Node *next; | |
| }; | |
| struct Queue { | |
| int size; |
This file contains hidden or 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 | |
| if [ $EUID -ne 0 ]; then | |
| echo "Run it as root, you silly goose!" | |
| exit 1 | |
| fi | |
| for dir in $(find / -name .git -type d); do | |
| cd $dir/.. | |
| git add * |
This file contains hidden or 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 | |
| title="tomates" | |
| pomodoro=25m | |
| rest=5m | |
| for i in `seq 3`; do | |
| echo "Work Time" | |
| sleep $pomodoro | |
| notify-send $title "Take a short rest" |
This file contains hidden or 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 | |
| for i in *.flac; do | |
| avconv -y -i "${i}" -filter_complex 'channelsplit=channel_layout=2[FL][FR]' -map '[FL]' "instrumental/${i}" -map '[FR]' /tmp/tmp.flac | |
| done | |
This file contains hidden or 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
| #include <avr/io.h> | |
| #include <util/delay.h> | |
| void spi_init(void) | |
| { | |
| /* | |
| * PB0: RST | |
| * PB2: CS #1 | |
| * PB3: MOSI | |
| * PB4: MISO |
NewerOlder