Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
magnetikonline / README.md
Last active June 14, 2024 14:27
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Assignment
Assign value to variable if variable is not already set, value is returned.

Combine with a : no-op to discard/ignore return value.
${variable="value"}
: ${variable="value"}
@selwyth
selwyth / bggxml_collquery.py
Last active February 19, 2024 19:55
Using BGG XML API2
user = raw_input('Enter BGG username')
url = 'http://www.boardgamegeek.com/xmlapi2/collection?username='
import requests
import time
# return collection for any user, but wait 2 seconds and retry if error. 10 total attempts.
def coll_final(USER):
for i in range(10): # try 10 times
r = requests.get(url + USER + "&rated=1&excludesubtype=boardgameexpansion&stats=1")
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@joyrexus
joyrexus / README.md
Last active June 19, 2024 09:35 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@urielka
urielka / ipin.py
Created September 3, 2012 12:37
iOS PNG uncrushers based on http://www.axelbrz.com.ar/?mod=iphone-png-images-normalizer with a fix for multiple IDAT
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007
#
# Author:
# Axel E. Brzostowski
# http://www.axelbrz.com.ar/
# axelbrz@gmail.com
#
# References: