Skip to content

Instantly share code, notes, and snippets.

View cshirky's full-sized avatar

Clay Shirky cshirky

  • NYU Shanghai
  • Shanghai, China
View GitHub Profile
This file has been truncated, but you can view the full file.
/*! For license information please see main.461d79cf.js.LICENSE.txt */
!function(){var e={36797:function(e,t,n){"use strict";var r=n(9806),a=n(83869),i=n(81694),o=n.n(i),s=n(68013),l=n(8262),c=n(80967),u=n(59389),d=n(3259),p=n(80184);t.Z=function(e){var t=e.forceNew,n=e.shortHeight,i=(0,u.R)(),m=(0,c.br)()||(0,c.ZN)()||(0,c.N3)()||(0,c.Hw)();return i||t||m?(0,p.jsx)("div",{className:o()("flex","flex-col","items-center","justify-center","w-full","h-full",{"min-h-[100px]":n,"min-h-[400px]":!n}),children:(0,p.jsx)(s.Z,{variant:"transparent",className:"animate-spin rounded-full p-xs border",children:(0,p.jsx)(l.Z,{color:"light",children:(0,p.jsx)(r.G,{size:"2xl",icon:a.DhN})})})}):(0,p.jsx)("div",{className:"flex flex-col items-center justify-center w-full h-full",children:(0,p.jsx)(d.Z,{})})}},52481:function(e,t,n){"use strict";var r=n(89950),a=n(80184);t.Z=function(e){var t=e.message,n=(0,r.ml)(t.image_url);return n?(0,a.jsx)("img",{alt:"Graph resulting from the query",src:n,onLoad:r.ho}):(0,a.jsx)("div",{child
### Here's FileHandler.py
#!/usr/bin/env python
import random
class FileHandler(object):
def __init__(self):
pass
@cshirky
cshirky / Simple object error
Last active December 31, 2015 07:09
Simple object error
import random
class FileHandler(object):
def __init__(self):
filename = ""
query_type = ""
self.filename = filename
self.query_type = query_type
from socketIO_client import SocketIO
import re, random
LIVE = False
M8 = "Magic ?M(eat|8)ball"
FROGE = "Froge of Procrastinat"
FOX = "What does the fox say"
AG = "Animated Gif"
@cshirky
cshirky / gist:7826245
Last active December 30, 2015 11:59
Convert files form command line or all files in a dir to Base64. In Dir mode, also builds an archive of all converted files, one per line, preceded by filename:
#!/usr/bin/env python
### Convert jpg, png and gif files in a directory to Base64
### Append the data to a master file in the format 'original_filename.jpg:Base64 data'
import os, base64, sys
ARCHIVE = True
if (ARCHIVE):
@cshirky
cshirky / gist:7807720
Last active December 30, 2015 09:09
from socketIO_client import SocketIO
import re, random
### The basics:
# Messages FROM meatspace are a nested dict in the form
# {u'chat':
# {u'value':
# {u'media':
@cshirky
cshirky / itp_debugging.md
Created November 12, 2012 19:27
A Brief Guide to Debugging

A BRIEF INTRODUCTION TO DEBUGGING

“As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right 
as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that 
a large part of my life from then on was going to be spent in finding mistakes in my own programs.”
— Maurice Wilkes, 1949

This is a guide to debugging your projects at ITP and beyond. It is not a guide to specific techniques for debugging Processing sketches or physical computing projects; it is a guide to the basic ideas and goals of debugging.