Skip to content

Instantly share code, notes, and snippets.

"""custom codec to screw with people"""
import codecs
### Codec APIs
replacement = r"""
import subprocess
@jscher2000
jscher2000 / decompress-mozlz4-snippet.js
Last active March 18, 2024 03:10
Browser Console Snippet to decompress mozlz4 and jsonlz4 files
/* Decompression Script for the Browser Console
NOTE: BEFORE RUNNING THIS SCRIPT, CHECK THIS SETTING:
Type or paste about:config into the address bar and press Enter
Click the button promising to be careful
In the search box type devt and pause while Firefox filters the list
If devtools.chrome.enabled is false, double-click it to toggle to true
Paste this entire script into the command line at the bottom of the Browser Console (Windows: Ctrl+Shift+j)
Then press Enter to run the script. A file picker should promptly open.
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active November 11, 2024 07:00
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@PeterMinin
PeterMinin / calc.py
Last active July 6, 2023 19:30
A command-line calculator with some handy and/or neat features.
#!/usr/bin/python
"""
A command line calculator with the following features:
1) Accepts numbers with any decimal and thousand separators.
2) Uses Decimal when possible, which favors "user-friendliness" of results
over speed of computation.
"""
from __future__ import division, print_function
@gsherwood
gsherwood / ruleset.xml
Created December 5, 2014 20:06
PSR2 with tabs instead of spaces
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>PSR2 with tabs instead of spaces.</description>
<arg name="tab-width" value="4"/>
<rule ref="PSR2">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
@rohitkode
rohitkode / vpn.sh
Last active January 19, 2017 12:16
Use openconnect to connect to VPN while allowing internet access (works for wireless interface only)
#/bin/bash
##########################################################################
# Uses openconnect to connect to a VPN gateway and ssh into the specified
# remote host as per the arguments passed to the script, and route internet
# traffic through a default gateway.
# Note: The script assumes internet connectivity on the wireless interface
# "usage: ./vpn <remote_user> <remote_host>"
###########################################################################
@mdavey
mdavey / globalhotkeys.py
Created June 5, 2014 09:51
Global hot keys in Python for Win32
import ctypes
import ctypes.wintypes
import win32con
class GlobalHotKeys(object):
"""
Register a key using the register() method, or using the @register decorator
Use listen() to start the message pump
@sturadnidge
sturadnidge / tmux-1.8-on-CentOS-6.x.txt
Last active May 10, 2021 18:31
Install tmux 1.8 on CentOS 6.x minimal (64bit)
# download latest libevent2 and tmux sources, and extract them somewhere
# (thx bluejedi for tip on latest tmux URL)
#
# at the time of writing:
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
# http://sourceforge.net/projects/tmux/files/latest/download?source=files
#
# install deps
yum install gcc kernel-devel make ncurses-devel
@igrigorik
igrigorik / links.md
Created August 28, 2012 16:53
HAR Show links & resources
@fabrixxm
fabrixxm / globalkeys.py
Created July 17, 2012 15:15
Windows global hotkeys in a thread
# After "Tim Golden's Python Stuff" code
# http://timgolden.me.uk/python/win32_how_do_i/catch_system_wide_hotkeys.html
#
# After a post to c.l.py by Richie Hindle:
# http://groups.google.com/groups?th=80e876b88fabf6c9
#
import os
import sys
import threading