Skip to content

Instantly share code, notes, and snippets.

@torrez
torrez / view-source.js
Created December 15, 2022 16:36
Bookmarklet to view-source on iOS Safari
javascript:(function()%7Bvar%20a=window.open('about:blank').document;a.write('%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3ESource:%20'+location.href+'%3C/title%3E%3Cmeta%20name=%22viewport%22%20content=%22width=device-width%22%20/%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E');a.close();var%20b=a.body.appendChild(a.createElement('pre'));b.style.overflow='auto';b.style.whiteSpace='pre-wrap';b.appendChild(a.createTextNode(document.documentElement.innerHTML))%7D)();
@torrez
torrez / partial.fish
Last active March 22, 2016 21:59
Partial fish config.
set normal (set_color normal)
set magenta (set_color magenta)
set yellow (set_color yellow)
set green (set_color green)
set red (set_color red)
set gray (set_color -o black)
# Fish git prompt
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
@torrez
torrez / .vimrc
Created July 25, 2012 04:28
my vimrc
" turn on syntax highlighting
syntax enable
" vibrant ink
colorscheme vibrantink
" turn anything longer than 80 characters red
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.\+/
@torrez
torrez / gist:3165045
Created July 23, 2012 18:03
VIM Requirements
1. Open files into splits
2. Flip between splits
3. As many splits as needed
4. Syntax highlighting for Python
5. Vibrant Ink
@torrez
torrez / captcha.md
Created June 14, 2012 22:15 — forked from Samuirai/captcha.md
G-WAN Captcha Decode

G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.

However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P

demo

They say the following about their Captcha:

@torrez
torrez / Shell log.sh
Created April 23, 2012 04:50 — forked from acdha/Shell log.sh
Contortions needed to create an AWS RDS database using UTF-8
brew install rds-command-line-tools
rds-create-db-parameter-group mysql-utf8 -f mysql5.1 -d "MySQL 5.1 configured for UTF-8"
rds-modify-db-parameter-group mysql-utf8 \
--parameters="name=character_set_server, value=utf8, method=immediate" \
--parameters="name=character_set_client, value=utf8, method=immediate" \
--parameters="name=character_set_results,value=utf8,method=immediate" \
--parameters="name=collation_server, value=utf8_general_ci, method=immediate" \
--parameters="name=collation_connection, value=utf8_general_ci, method=immediate"
@torrez
torrez / css-centering.css
Created July 9, 2011 23:40
CSS Centering
body {
text-align: center;
}
#container {
margin: 0 auto;
width: 850;
text-align: left;
}
@torrez
torrez / python-pip-compile
Created June 8, 2011 04:39
Command for compiling with xcode4
ARCHFLAGS="-arch i386 -arch x86_64"
@torrez
torrez / main.py
Created November 10, 2010 05:43
test of asynchronous test
#!/usr/bin/env python
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.httpclient
from tornado.testing import AsyncHTTPTestCase
class MainHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
#!/usr/bin/env python
import tweepy
import sys
import webbrowser
arguments = sys.argv[1:]
if len(arguments) < 2:
print "Missing consumer keys.\n"