Skip to content

Instantly share code, notes, and snippets.

View pdswan's full-sized avatar

Peter Swan pdswan

View GitHub Profile
@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active April 26, 2024 19:34
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@carlisia
carlisia / rom-references
Last active January 8, 2019 10:23
ROM - References for creating a custom adapter
We couldn’t find that file to show.
@gmccreight
gmccreight / master.vim
Last active September 23, 2023 08:41
A script that gives you a playground for mastering vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@gilesbowkett
gilesbowkett / compare_branches.bash
Last active December 25, 2015 15:39
script to compare all branches by date of most recent commit. silences `stderr` because otherwise git tells you every time it switches branches
function silencing_stderr() {
$* 2>/dev/null
}
function branch_names() {
git br | awk '{print $1}' | grep -v '*' | xargs
}
function most_recent_commit() {
git log . | grep "Date: " | cut -c 9- | head -1
@phaedryx
phaedryx / summary
Last active December 3, 2022 19:27
Loyalty and Layoffs by David Brady
Original text here: https://whydavewhy.com/2013/08/16/loyalty-and-layoffs/
@stympy
stympy / error.json
Created October 3, 2012 12:56
Sample Honeybadger error payload
{
"notifier":{
"name":"Honeybadger Notifier",
"url":"https://github.com/honeybadger-io/honeybadger-ruby",
"version":"1.3.0"
},
"error":{
"class":"RuntimeError",
"message":"RuntimeError: This is a runtime error, generated by the crywolf app at 2012-09-26 17:25:24 -0700",
"backtrace":[
@apeckham
apeckham / gist:3388159
Created August 18, 2012 16:29
jasmine testing that event.preventDefault was called
var event = $.Event('tap');
$fixtures.find('.random').trigger(event);
expect(event.isDefaultPrevented()).toBeTruthy();
@dkubb
dkubb / eager_repository.rb
Last active May 13, 2019 21:10
Eager Loading DataMapper Associations
require 'memoist'
# Usage:
#
# customers = Customer.preload(Customer.orders.line_items.item)
#
# customers.each do |customer|
# customer.orders.each do |order|
# order.line_items.each do |line_item|
# line_item.item # yay, no more N+1, only 4 queries executed !
@p01
p01 / LICENSE.txt
Last active March 9, 2024 13:40 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bklang
bklang / pry-threads.rb
Created June 10, 2011 14:59
Pry threading test
require 'rubygems'
require 'pry'
#require 'rbtrace'
puts $$
threads = []
threads << Thread.new do
loop do
puts "Thread 1"
sleep 1