Skip to content

Instantly share code, notes, and snippets.

View trizz's full-sized avatar
🥃

Tristan trizz

🥃
View GitHub Profile
@afeld
afeld / README.md
Last active March 8, 2022 18:40
automatic virtualenv switching

This script will automatically switch to a Python virtual environment after you cd into a Python project, then deactivate when you leave. Inspired by a similar script from Justin Abrahms.

Installation

  1. Install virtualenvwrapper.

  2. Download the auto_virtualenv.sh script, and put it in your home directory (~/).

  3. Run the following:

chmod a+x ~/auto_virtualenv.sh

@jwage
jwage / .php_cs
Last active May 3, 2023 06:42
php-cs-fixer git pre commit hook
<?php
return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'short_array_syntax',
'ordered_use',
])
;
@mikesmullin
mikesmullin / watch.sh
Last active April 26, 2023 05:20
watch is a linux bash script to monitor file modification recursively and execute bash commands as changes occur
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
# import threading
class WebSocketsHandler(SocketServer.StreamRequestHandler):
<html>
<span style="background: #0000ff"> &nbsp; 1 &nbsp; </span>
<span style="background: #000df1"> &nbsp; 2 &nbsp; </span>
<span style="background: #001ae3"> &nbsp; 3 &nbsp; </span>
<span style="background: #0027d5"> &nbsp; 4 &nbsp; </span>
<span style="background: #0034c7"> &nbsp; 5 &nbsp; </span>
<span style="background: #0041b9"> &nbsp; 6 &nbsp; </span>
<span style="background: #004eab"> &nbsp; 7 &nbsp; </span>
<span style="background: #005b9d"> &nbsp; 8 &nbsp; </span>
<span style="background: #00688f"> &nbsp; 9 &nbsp; </span>