Skip to content

Instantly share code, notes, and snippets.

View rchrd2's full-sized avatar

Richard Caceres rchrd2

View GitHub Profile
@aviddiviner
aviddiviner / run-service.sh
Created March 4, 2014 00:11
Quick bash wrapper around a service; allows for environment setup and sends trapped signals
#!/bin/bash
handler () {
kill -s SIGINT $PID
while kill -0 $PID &>/dev/null
do
wait $PID
done
}
@robdodson
robdodson / index.html
Created July 10, 2015 21:19
poly-storage
<!DOCTYPE html>
<html>
<head>
<!-- Web Components -->
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/iron-localstorage/iron-localstorage.html">
</head>
<body unresolved>
@qtrandev
qtrandev / Polymer
Last active November 6, 2015 04:02
Polymer 1.0 snippets and notes from Polycasts YouTube videos
Info:
=====
These snippets help me remember how to use Polymer syntax. Many come from the Polycasts YouTube videos.
Message me @qtrandev in the Polymer Slack or email qtrandev@gmail.com and I'll message you links I know.
Getting started:
================
bower init
bower install --save Polymer/polymer#^1.0.0
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
cat > .git/hooks/pre-commit
#!/bin/sh
make test
@amundo
amundo / html2text.py
Created May 14, 2011 05:36
unescape hex entities in html
#!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "2.35"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes"]
# TODO:
# Support decoded entities with unifiable.
# Relative URL resolution
@schocco
schocco / gist:1762611
Created February 7, 2012 22:36
encode any string to html
# can be used to hide email addresses in the html source of Web sites from spiders
def html_encode(email):
'''
Takes a unicode string as only parameter and returns
a sequence of html encoded chars.
>>> html_encode(u"test@website.org")
'&#116;&#101;&#115;&#116;&#64;&#119;&#101;&#98;&#115;&#105;&#116;&#101;&#46;&#111;&#114;&#103'
'''
@neutronstein
neutronstein / share_text_attach_ace.js
Last active April 23, 2016 03:59 — forked from geakstr/share_text_attach_ace.js
Ace editor (v1.2.3) and ShareJS (v0.7.40) text adapter
function attachAce(editor, doc) {
if (!doc.provides.text) {
throw new Error("Cannot attach ace to non-text share document");
}
let suppress = false;
editor.setValue(doc.getSnapshot() || "");
check();
const newline = editor.session.getDocument().getNewLineCharacter();
@dr-dimitru
dr-dimitru / simplest-nodejs-nginx-config.conf
Created October 28, 2013 00:49
Simplest way for Nginx as Node.js reverse proxy [CONFIG]
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://mystream;
proxy_set_header Host $http_host;
}
}
@jeremydw
jeremydw / gist:bc901de8b7e59cbeb190
Created February 27, 2015 02:06
Python webapp2 application that serves files behind HTTP Basic Auth
import webapp2
import mimetypes
import os
import time
from datetime import datetime
import base64
_here = os.path.dirname(__file__)
USERNAME = 'foo'
@rchrd2
rchrd2 / freeway-2600.asm
Last active October 20, 2017 06:50
Honking & collision sound are redacted
; Disassembly of roms/Freeway (1981) (Activision).a26
; Disassembled Thu Oct 19 22:17:47 2017
; Using DiStella v3.01a
;
; Command Line: ./binaries/osx/distella -pafs roms/Freeway (1981) (Activision).a26
;
processor 6502
VSYNC = $00
VBLANK = $01