Skip to content

Instantly share code, notes, and snippets.

@twerp
twerp / 0_reuse_code.js
Created January 3, 2014 18:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You need to back them up manually. If you log into an online GFWL account you only need to backup the GTA IV "savegames" folder. In Windows XP it is located in: C:\Documents and Settings\<user>\Local Settings\Application Data\Rockstar Games\GTA IV\ In Windows Vista/Windows 7 it is located in: C:\Users\<user>\AppData\Local\Rockstar Games\GTA IV\ If you use an offline GFWL account you will also need to backup the "xlive" folder. In Windows XP it is located in: C:\documents and settings\<user>\Local Settings\Application Data\Microsoft In Windows Vista/Windows 7 it is located in: C:\Users\<user>\AppData\Local\Microsoft\ *Note* You may need to set windows to show hidden files and folders to be able to get to these folders. Then once you have formatted your computer and reinstalled the game (including Games For Windows Marketplace/Games For Windows Live) just copy the folders back to their relevant locations. Then when you run GTA IV press "Home" to bring up GFWL and sign into your old nickname to be able to l
account Yahoo
tls on
tls_starttls off
tls_certcheck off
auth on
host smtp.mail.yahoo.com
user user@yahoo.com
from user@yahoo.com
password password
@twerp
twerp / README.md
Created August 7, 2014 19:40 — forked from AviDuda/README.md
@twerp
twerp / pycdump.py
Created November 17, 2016 17:34 — forked from anonymous/pycdump.py
Dump .pyc file (Python 3.5 version)
#
# read a .pyc file and pretty-print it
#
# copied from http://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html
# and updated to Python 3.5 (Nov 10th 2015)

Design Recipes

In this course, we teach an approach to program design based on design recipes. Each recipe is applicable to certain problems, and systematizes the process of designing solutions to those problems.

There are three core recipes that are used most frequently. The templating recipes are used as part of the design of every data definition and function. Abstraction recipes are used to reduce redundancy in code.

You can also download a condensed version of some of the design recipes here for easy reference.

Core Recipes

@twerp
twerp / lofi.bat
Created November 2, 2017 13:34
Use GhostScript (for Windows) to optimize a PDF doc
gswin64c.exe -o "%~n1-optimized.pdf" -sDEVICE=pdfwrite -dPDFSETTINGS=/default %1
@twerp
twerp / expand.bat
Created November 2, 2017 13:38
Use mutool (from mupdf) to expand ("clean") a PDF doc
mutool clean -d %1 "%~n1-cleaned.pdf"
@twerp
twerp / clear_event_logs.cmd
Created November 2, 2017 13:40
Clear Windows 8+ event logs (use at your own risk)
@for /f "delims=," %%i in ( 'wevtutil el' ) do wevtutil cl "%%i" >NUL 2>&1
@twerp
twerp / run.bat
Created November 2, 2017 13:45
Remove protection ("encryption") from a PDF doc
@echo off
FOR %%a IN (*.pdf) DO call unprotect.bat "%%a"