Skip to content

Instantly share code, notes, and snippets.

View MrValdez's full-sized avatar

MrValdez MrValdez

View GitHub Profile
@simonw
simonw / recover_source_code.md
Last active September 14, 2025 04:26
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@melrhoyd
melrhoyd / garbida_english_walkthrough_wizardshouse
Created April 17, 2013 03:21
WIZARD'S HOUSE - english - a walkthrough using Allegro CL Free Express Edition 9.0 Release
CG-USER(1):
; Fast loading C:\acl90express\garbida-english.fasl
Warning: WELD was a function and is being redefined as a macro
Warning: DUNK was a function and is being redefined as a macro
CG-USER(1): (helper)
(AVAILABLE COMMANDS INSIDE THE PARENTHESES - FOLLOW THE SYNTAX PROVIDED (LOOK) '>TO SEE THE CURRENT LOCATION
OBJECTS AND DIRECTIONS AVAILABLE (WALK <DIRECTION>) '>TO NAVIGATE TO THE DIFFERENT LOCATIONS
(PICKUP <OBJECT>) '>TO GET THE OBJECT ON THE CURRENT LOCATION (WELD <SUBJECT> <OBJECT>) '>TO TIE UP THE
TWO OBJECTS ON-HAND (DUNK <OBJECT>) '>TO FETCH WATER ONTO THE BUCKET (SPLASH <OBJECT> <CHARACTER>) '>TO
POUR WATER ONTO SOMEBODY (INVENTORY) '>TO CHECK THE OBJECTS ON-HAND)
@melrhoyd
melrhoyd / garbida_english_wizardshouse.lisp
Last active December 16, 2015 07:49
WIZARD'S HOUSE - english version - created by MRDG thru the instructions of Prof. Sony Valdez of University of the Cordilleras as a requirement for our MIT course (MIT C01)
; CASTING SPELS in LISP
; A Comic Book by Conrad Barski, M.D.
; www.lisperati.com
; Endorsed by: Prof. Sony Valdez as a requirement in
; MIT C01 - Theory of Programming Languages
; Encoded and Evaluated by: Melvin Roy D. Garbida
; To prevent Allegro from chopping off messages printed by our text adventure game.
(setf tpl:*print-length* nil)
@joenhel-arcilla
joenhel-arcilla / wizworld.lisp
Created April 15, 2013 06:42
Sample Study Code based on LISP SPEL Tutorial from http://www.lisperati.com/casting.html
;;; Study: LISP Coding
;;; Codes from lisperati.com
;;; - Converted the messages and commands to Filipino Language
;;; Subject: MIT C01 - Theory of Programming Languages
;;; By: Joenhel Arcilla
(setf tpl:*print-length* nil)
;;; creates the help instructions
@marvinmm
marvinmm / game_expanded_lisp
Created April 15, 2013 06:36
Modified code from Casting SPELS Tutorial at http://lisperati.com/casting.html. Created as part of the requirements for Theory of Programming Languages (MIT Course, University of the Cordilleras, 3rd Trimester, S/Y 2012-2013)
;;; The Game
(setf *objects* '(whiskey-bottle bucket frog chain metallic-badge glowing-flower))
(setf *map* '(
(living-room
(you are in the living-room of a wizards house. there is a wizard snoring loudly on the couch.)
(west door garden)
(upstairs stairway attic)
)