Skip to content

Instantly share code, notes, and snippets.

View csu's full-sized avatar

Christopher Su csu

  • San Francisco, CA
View GitHub Profile
javascript:(function()%7Bvar%20d%3Ddocument%2Cw%3Dwindow%2Ce%3Dw.getSelection%2Ck%3Dd.getSelection%2Cx%3Dd.selection%2Cs%3D(e%3Fe()%3A(k)%3Fk()%3A(x%3Fx.createRange().text%3A0))%2Cl%3Dd.location%2Ce%3DencodeURIComponent%2Cp%3D'%22'%2B((e(s))%3Fe(s)%3Ae(document.title))%2B'%22%20'%2Be(l.href)%3Bwindow.open('http%3A%2F%2Fcircular.io%2F%3Fp%3D'%2Bp)%7D)()
@csu
csu / gist:5252295
Last active December 15, 2015 11:19
Link to control iFrame
<a href="/files/theme/map_guangdong.html" TARGET="dataframe" id="rectangle11">
@csu
csu / gist:5252298
Created March 27, 2013 06:57
Embedding PDF documents using Google Docs
<iframe src="http://docs.google.com/gview?url=http://18069595.nhd.weebly.com/files/theme/dikotter-transcript.pdf&embedded=true" style="width:900px; height:900px;" frameborder="0"></iframe>
@csu
csu / gist:5252291
Created March 27, 2013 06:55
Interactive Data Map iFrames
<iframe name="mapframe" id="mapframe" src="http://18069595.nhd.weebly.com/files/theme/mapframe.html" height=400 width=58%></iframe>
<iframe name="dataframe" id="dataframe" src="http://18069595.nhd.weebly.com/files/theme/dataframe.html" height=400 width=40%></iframe>
#!/usr/bin/env python
import urllib2
import pinboard
pinuser = raw_input('Pinboard username: ')
pinpasswd = raw_input('Pinboard password: ')
oldtag = raw_input('Tag to rename: ')
newtag = raw_input('Rename tag to: ')
@csu
csu / nginxproxy.md
Created January 21, 2016 05:02 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

javascript:(function()%7Bdocument.getElementsByClassName('compose-text-container')%5B0%5D.onpaste%20%3D%20function%20(event)%20%7Bvar%20items%20%3D%20(event.clipboardData%20%20%7C%7C%20event.originalEvent.clipboardData).items%3B%2F%2F%20find%20pasted%20image%20among%20pasted%20itemsvar%20blob%3Bfor%20(var%20i%20%3D%200%3B%20i%20%3C%20items.length%3B%20i%2B%2B)%20%7Bif%20(items%5Bi%5D.type.indexOf(%22image%22)%20%3D%3D%3D%200)%20%7Bblob%20%3D%20items%5Bi%5D.getAsFile()%3B%7D%7D%2F%2F%20load%20image%20if%20there%20is%20a%20pasted%20imageif%20(blob%20!%3D%3D%20null)%20%7Bvar%20reader%20%3D%20new%20FileReader()%3Breader.onload%20%3D%20function(event)%20%7Bmedia_el%20%3D%20'%3Cdiv%20class%3D%22compose-media-bar-holder%20padding-al%22%3E'%20%2B'%3Cdiv%20class%3D%22compose-media-bar%22%3E'%20%2B'%3Ca%20class%3D%22js-media-bar-remove%20compose-media-bar-remove%20is-actionable%22%3E'%20%2B'%3Ci%20class%3D%22sprite%20sprite-close%22%3E%3C%2Fi%3E'%20%2B'%3C%2Fa%3E'%20%2B'%3Cimg%20class%3D%22js-media-bar-thumb%20compose-
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository=https://pypi.python.org/pypi
running upload
Submitting dist/steam_market-0.2.0.tar.gz to http://pypi.python.org/pypi
Upload failed (403): Must access using HTTPS instead of HTTP
python setup.py sdist upload -r pypi