Skip to content

Instantly share code, notes, and snippets.

View tsabat's full-sized avatar

Tim Sabat tsabat

View GitHub Profile
@tsabat
tsabat / Fullpage.html
Created June 19, 2012 19:49
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>this is a fin title &middot; CodePen</title>
<style>
@tsabat
tsabat / Fullpage.html
Created June 19, 2012 19:49
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>this is a fin title &middot; CodePen</title>
<style>
@tsabat
tsabat / slug.rb
Created July 2, 2012 04:36
slug.rb
class Slug
def self.substituion
{
'0' => 'c',
'1' => '0',
'2' => 'd',
'3' => '3',
'4' => 'p',
'5' => 'e',
@tsabat
tsabat / short_urls.md
Created July 5, 2012 03:05
Generating a bank of unique hashes for short URLs

###The Problem:

How do you create URLs that are short, easy to remember, and unique? Also, how do you store 60M rows so they are easily accessable?

###Getting the data

Get all 5 letter permutations for the letters between a and z as well as A through F.

###The Source

@tsabat
tsabat / gist:3261228
Created August 5, 2012 02:44
sinatra tomcat security manager settings
grant {
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.util.PropertyPermission "jruby.*", "read";
permission java.util.PropertyPermission "jruby.*", "write";
permission java.util.PropertyPermission "java.io.tmpdir", "read";
permission java.util.PropertyPermission "*", "read";
permission java.util.PropertyPermission "*", "write";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.RuntimePermission "getProtectionDomain";
@tsabat
tsabat / security_manager.rb
Created August 6, 2012 18:56
security_manager.rb
require 'haml'
require 'java'
class JRubySecurityManager < java.lang.SecurityManager
def checkPermission(perm)
puts perm.inspect
#puts perm
end
#def checkWrite(f)

###Background

My table looks like this:

id (int), hash_value (text)

with the following settings:

InnoDB

utf8

1c1
< File.stuff
---
> stuff
eval ("File.read('/tmp/blah.rb')")
eval("File.read('/tmp/blah.rb')")
eval "File.read('/tmp/blah.rb')"
x = "Fil"+"e.read('/tmp/blah.rb'"
eval(x)
eval (x)
eval x
eval x
mysql> show variables like 'collation%';
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)