Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# encoding: utf-8
from gevent import monkey; monkey.patch_all()
from socketio.namespace import BaseNamespace
from socketio import socketio_manage
from bottle import route, request, static_file, run
import logging
@jorgehatccrma
jorgehatccrma / resonantSequences.ipynb
Last active August 29, 2015 14:18
Resonant Sequences
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jorgehatccrma
jorgehatccrma / MonomialFinding.ipynb
Last active August 29, 2015 14:19
3freq monomial finding relevant code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jorgehatccrma
jorgehatccrma / hammerPinch.html
Created March 29, 2013 06:22
Simple example using hammer.js to handle pinch and other multitouch gestures
<html>
<head>
<script src="js/hammer.js-1.0.4/hammer.min.js"></script>
<!--script src="js/hammer.js-1.0.4/hammer.fakemultitouch.js"></script-->
</head>
<body >
@jorgehatccrma
jorgehatccrma / gr-test.html
Last active December 28, 2015 04:19
Code to demonstrate a bug with polymer+jquery
<polymer-element name="gr-test">
<template>
<p>Hi there!</p>
</template>
<script>
Polymer('gr-test', {
ready: function() {
console.log("ready");
@jorgehatccrma
jorgehatccrma / webCompTest.html
Last active December 28, 2015 18:18
polymer bug?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<!-- Including this makes the code below crash -->
<!--script src="libs/polymer.min.js"></script-->
<script type="text/javascript" src="libs/jquery-1.9.1.js"></script>
</head>
@jorgehatccrma
jorgehatccrma / grok_vi.mdown
Last active February 25, 2017 06:22 — forked from nifl/grok_vi.mdown
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@jorgehatccrma
jorgehatccrma / colors.sh
Last active March 23, 2018 17:30
Small bash script to print terminal color codes with bash
cumwidth=7
for i in {0..255}; do
printf "\x1b[38;5;${i}m [%03i] \x1b[0m" $i ;
if [ $i -eq $cumwidth ]; then
echo ;
if [ $cumwidth -ge 15 ]; then
((cumwidth+=6))
else
((cumwidth+=8))
fi ;
@jorgehatccrma
jorgehatccrma / awk1liners.md
Created April 12, 2018 18:20
AWK one liners

HANDY ONE-LINE SCRIPTS FOR AWK

Based on this gist compiled by Eric Pement - eric [at] pement.org

USAGE:

awk '/pattern/ {print "$1"}'    # standard Unix shells

FILE SPACING:

@jorgehatccrma
jorgehatccrma / demoLuceneJython.py
Last active April 12, 2019 09:33
Lucene + Jython
"""
This simple Jython script shows how to use Apache Lucene
directly in a Jython script
"""
# your usual Python imports
import sys
from contextlib import contextmanager
# add jars to classpath