Skip to content

Instantly share code, notes, and snippets.

View commadelimited's full-sized avatar

Andy Matthews commadelimited

View GitHub Profile
@commadelimited
commadelimited / 2011-11-25-01.jsx
Created January 19, 2012 19:24
Scripting Photoshop with ExtendScript
// bring Photoshop into focus
// This also allows you to simply double click the JSX file
#target photoshop
// set some default variables
var docRef = app.activeDocument;
// remember this is JavaScript. That means I can take
// input from a user in the form of a prompt. Awesome right?
var fileName = prompt('Please enter base file name', docRef.name);
http://www.meeplemountain.com/articles/comparing-boardgamegeek-collections-of-two-users/
Agricola: All Creatures Big and Small
The Castles of Burgundy
Favor of the Pharaoh
For Sale
Jaipur
Lost Cities
No Thanks!
Patchwork
@app.route('/')
@app.route('/page/<int:page_number>/')
def index(page_number=1):
path = '' if request.url_rule.rule == '/' else request.url.replace(request.url_root, '/')
context = {
'pagination': Pagination(page_number, settings.PER_PAGE, sorted_pages),
'canonical_url': '{root}{path}'.format(root=settings.ROOT_URL, path=path)
}
return render_template('index.html', context=context)
from collections import (
defaultdict,
OrderedDict,
)
games = [
{
'categories': ['Deduction', 'Party Game', 'Spies/Secret Agents', 'Word Game'],
'game': 'Codenames',
'id': 178900,
  • scale in A minor. The second string of the violin is tuned to the A
  • scale determined by certain general thermo-dynamic principles, and
  • scale of absolute temperature. It is equivalent to -273º centigrade
  • scholar." Johnson.
  • scholarly; literary or classical, in distinction from scientific.
  • scire to know.]
  • scale graduated so as to indicate the percentage of pure alcohol,
  • scented flowers.
  • scholars.
  • scruples, 480 grains. See Troy weight.
import sys
word = sys.argv[1] # 'dad'
emoji = sys.argv[2] # 'parrot_dad'
letters = dict(
a=[
[1, 1, 1, 1, 0],
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
emoji = 'square'
letter = 'a'
letters = dict(
a=[
[1, 1, 1, 1, 1, 0],
[1, 0, 0, 0, 1, 0],
[1, 0, 0, 0, 1, 0],
[1, 1, 1, 1, 1, 0],
@commadelimited
commadelimited / _readme
Last active March 18, 2016 22:24
Sass-json-vars example
Running the sass compile command results in the output listed in output.sh. Here's my current sass version:
`Sass 3.2.14 (Media Mark)`
@commadelimited
commadelimited / temp.py
Created January 20, 2016 19:47
', '.join() fails in script, works in iPython
final = [u'Blokus Trigon', u'Coloretto', u'Friday (2)', u'Luna', u'Mancala (2)', u'Medieval Academy', u'No Thanks! (3)', u'Patchwork', u'Pi\xf1ata', u'Port Royal', u'Rhino Hero', u'Roll For It!', u'Rolling America', u'Star Realms', u'Tsuro']
', '.join(final)
# results in
u'Blokus Trigon, Coloretto, Friday (2), Luna, Mancala (2), Medieval Academy, No Thanks! (3), Patchwork, Pi\xf1ata, Port Royal, Rhino Hero, Roll For It!, Rolling America, Star Realms, Tsuro'
@commadelimited
commadelimited / multi-task.js
Last active January 17, 2016 20:33
grunt-multi-task-order.js
concat: {
options: {
// separator: ''
},
colors: {
options: {
banner: 'var colors = ',
footer: ';'
},
files: {