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 | |
in_path () { | |
IS_IN_PATH=1 | |
if [ -n "$1" ] | |
then | |
command -v $1 >/dev/null 2>&1 || { IS_IN_PATH=0; } | |
fi | |
return ${IS_IN_PATH} | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>tornado WebSocket example</title> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-icons.min.css" rel="stylesheet"> | |
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>tornado WebSocket example</h1> |
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
# Edit this file to introduce tasks to be run by cron. | |
# | |
# Each task to run has to be defined through a single line | |
# indicating with different fields when the task will be run | |
# and what command to run for the task | |
# | |
# To define the time you can provide concrete values for | |
# minute (m), hour (h), day of month (dom), month (mon), | |
# and day of week (dow) or use '*' in these fields (for 'any').# | |
# Notice that tasks will be started based on the cron's system |
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
""" | |
File: gitlab_webhooks/app.py | |
Author: John Andersen | |
Description: A webserver to receive json web hooks from gitlab_webhooks | |
The hooks are dealt with by calling the corresponding function in | |
hooks.py. For example a push is received so the function push in | |
hook.py is called and passed the hook data. | |
Crontab line to run on reboot | |
@reboot /usr/bin/python /path/to/gitlab_webhooks/app.py 9898 |
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/env python | |
import sys | |
import ssl | |
import thread | |
import argparse | |
import itertools | |
import irc.client | |
__connection__ = False |
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
vid2images() { | |
mplayer -ao null $1 -vo jpeg:outdir=${1}_images | |
} | |
images2gif() { | |
convert ${1}_images/* ${1}_unoptimized.gif | |
convert ${1}_unoptimized.gif -fuzz 10% -layers Optimize ${1}.gif | |
} | |
gifit() { |
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 is my docstring | |
John Andersen | |
""" | |
import sys | |
def main(): | |
print sys.modules[__name__].__doc__ |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"time" |
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/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
#!/bin/bash | |
PRODUCT_NAME="someproject" |
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
# Go path | |
export GOPATH=$HOME/Documents/go | |
mkdir -p $GOPATH/bin | |
export PATH=$PATH:$GOPATH/bin | |
TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1)); history -r' | |
export PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ ' | |