Skip to content

Instantly share code, notes, and snippets.

import pygame
from pygame import locals
import socket
import atexit
pygame.init()
pygame.joystick.init() # main joystick device system
try:
@tazjel
tazjel / gist:57f08d97656125f768a5448865e9cb70
Created April 3, 2016 21:10 — forked from akolosov/gist:cedaac86b333a4ced95f
vim 7.4 with lua+GUI on Ubuntu 14.04
#!/bin/sh
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo mkdir /usr/include/lua5.1/include
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include
cd ~
hg clone https://code.google.com/p/vim/
@tazjel
tazjel / gruber_urlintext.py
Created February 18, 2016 03:41 — forked from uogbuji/gruber_urlintext.py
John Gruber's regex to find URLs in plain text, converted to Python/Unicode
#See: http://daringfireball.net/2010/07/improved_regex_for_matching_urls
import re, urllib
GRUBER_URLINTEXT_PAT = re.compile(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))')
for line in urllib.urlopen("http://daringfireball.net/misc/2010/07/url-matching-regex-test-data.text"):
print [ mgroups[0] for mgroups in GRUBER_URLINTEXT_PAT.findall(line) ]
@tazjel
tazjel / paste.html
Created December 22, 2015 01:50 — forked from Buildstarted/paste.html
Used to capture the clipboard in both mozilla and webkit browsers
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<!-- normally you wouldn't show this -->
<div id="paste" contenteditable="true"></div>
<script type="text/javascript">
@tazjel
tazjel / .bash_profile
Created December 22, 2015 01:31 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@tazjel
tazjel / install-eden-apache-mysql.sh
Created December 9, 2015 19:11 — forked from ScottEvil/install-eden-apache-mysql.sh
Pre-Install steps for Sahana Eden for Ubuntu 14.04
#!/bin/sh
# Script to turn a generic Debian Squeeze box into an Eden server
# with Apache & MySQL
# Update system
apt-get update
#apt-get upgrade -y
# Install Admin Tools
apt-get install -y unzip
# Install Git
apt-get install -y git-core
@tazjel
tazjel / praytimes.py
Last active August 29, 2015 14:27 — forked from zsmahi/praytimes.py
a simple python script showing how to calculate praytimes
#!/usr/bin/env python
# compatible with python 2.x and 3.x
import math
import re
'''
--------------------- Copyright Block ----------------------
praytimes.py: Prayer Times Calculator (ver 2.3)
!#/usr/bin/python
import mechanize
import getpass
import time
import os
def reload(username=None, password=None, domain=None):
if username is None:
username = raw_input('Username: ')
@tazjel
tazjel / zsh.md
Last active August 29, 2015 14:08 — forked from tsabat/zsh.md
controller:
def index()
return dict(latitude=session.latitude, longitude=session.longitude)
def set_location():
session.latitude = request.vars.lat
session.longitude = request.vars.lng
default/index.html: