Skip to content

Instantly share code, notes, and snippets.

@passcod
passcod / LOLcryption.js
Created November 2, 2012 08:34 — forked from jason-s13r/LOLcryption.js
enLOLcryption.
String.prototype.enlolcrypt = function (cipher) {
cipher = cipher || "aeoiubcdfghjklmnpqrstvwxyz";
return this.split("").map(function (T) {
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T);
if (/[^a-z]/.test(T)) { return T; }
if ((new RegExp("["+cipher.substr(0,5)+"]")).test(T)) {
T = cipher[(i+2)%5];
} else {
T = cipher[(i+5)%21+5];
@passcod
passcod / gist:3999369
Created November 2, 2012 07:58
LOLcrypt Ruby
def lolcrypt(str, decrypt = false)
cipher = "aeoiubcdfghjklmnpqrstvwxyz"
str.split("").map { |t|
caps = /[A-Z]/ =~ t
t.downcase!
i = cipher.index t
if /[a-z]/ =~ t
t = cipher[ /[aeoiu]/ =~ t ? (decrypt ? i-2 : i+2)%5 : (decrypt ? i-15 : i+5)%21+5 ]
end
@passcod
passcod / LOLcryption.js
Created November 2, 2012 07:10
enLOLcryption.
String.prototype.enlolcrypt2 = function () {
var cipher = "aeoiubcdfghjklmnpqrstvwxyz";
return this.split("").map(function (T) {
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T);
if (/[^a-z]/.test(T)) { return T; }
if (/[aeoiu]/.test(T)) {
T = cipher[(i+2)%5];
} else {
T = cipher[(i+5)%21+5];
@passcod
passcod / gist:3984651
Created October 31, 2012 03:37
woot color2
/* Source: */
String.prototype.color2 = function(fg,bg) {
var conv = function(thing, _default) {
if (+thing < 16 && +thing > -1) { return +thing; }
thing = "white black blue green red brown purple orange yellow lime teal cyan royal pink grey silver".split(" ").indexOf(thing);
if (thing != -1) { return thing; }
return _default;
};
---
title: blog
layout: default
advlayout: true
---
<section class="ninecol">
<h1>Latest post: <a href="{{ site.posts.first.href }}">{{ site.posts.first.title }}</a></h1>
</section>
<nav class="threecol last">
@passcod
passcod / dabblet.css
Created October 18, 2012 08:09
New way to center stuff...
/**
* New way to center stuff...
*/
b or not.ody, html {
text-align: center;
height: 100%;
}
i {
@passcod
passcod / codemirror-theme.css
Created October 16, 2012 04:08
Port of @LeaVerou's prism.js Dark theme for CodeMirror
@charset "UTF-8";
/**
* prism.js Dark theme for JavaScript, CSS and HTML
* Based on the slides of the talk “/Reg(exp){2}lained/”
* @author Lea Verou
*
* Adapted for CodeMirror
* @author Félix Saparelli
*/
#!/bin/bash
if ! `command -v hub >/dev/null 2>&1`
then
echo "Missing dependency: hub."
echo "Install it with \`brew install hub\`."
exit 1
fi
if ! `command -v ruby >/dev/null 2>&1`
@passcod
passcod / gist:3793320
Created September 27, 2012 10:20
Sample onthesides job
# Fetch a list of words to search
# for on Twitter, and return the
# last ~10 people who used each.
# There's a bunch of libraries you
# can use. E.g. typhoeus for HTTP.
url = "https://raw.github.com/gist/123456"
watch = Typhoeus::Request.get url
# YAML, JSON, Nokogiri for XML, Base64...
@passcod
passcod / Gemfile
Created September 20, 2012 05:15
Padrino + Sidekiq = ♥
# ...
gem 'sidekiq'
# ...