Skip to content

Instantly share code, notes, and snippets.

Regex longFormat = new Regex(@"^15-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}$");
Regex shortFormat = new Regex(@"^5-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}$");
return (longFormat.IsMatch(str) || shortFormat.IsMatch(str));
@jls
jls / dot_bashrc
Created September 14, 2009 15:17
set ai
set ts=2
set bs=1
syntax enable
set shiftwidth=2
set shiftround
set expandtab
set smarttab
set pastetoggle=<F2>
set showmatch
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@jls
jls / RoundedCorners
Created April 19, 2010 00:11
RoundedCorners.h
#import <Foundation/Foundation.h>
#import "QuartzCore/QuartzCore.h"
@interface RoundedCorners : NSObject {
}
+ (void) setView:(UIView *) view cornerRadius:(float) radius;
@end
@jls
jls / Mysql Gem Error
Created May 17, 2010 14:54
Mysql Gem Error
Received this error:
uninitialized constant MysqlCompat::MysqlRes
Used this command on snow leopard:
export ARCHFLAGS="-arch i386 -arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config
# /usr/lib/ruby/gems/1.8/gems/zencoder-2.1.13/lib/zencoder/http.rb
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
# DAMMIT! Or you can just read the docs and figure out you can do this...
Zencoder::HTTP.default_options.merge!(:skip_ssl_verify => true)
<% @channel.articles.each do |article| %>
# all values of the article are available here
<% end -%>
var app = $.sammy(function(){
this.element_selector = '#content';
this.get(/\#!\/(.*)/, function(context){
this.partial('/' + this.params['splat']);
});
});
$(document).ready(function(){
app.run('#!/');
});
var app = $.sammy(function(){
this.element_selector = '#content';
this.get(/\#!\/(.*)/, function(context){
this.partial('/' + this.params['splat']);
});
});
$(document).ready(function(){
app.run('#!/');
// We will setup all of our links in the
@jls
jls / punndit_bar_embed_example.html
Created August 18, 2011 19:52
Example Punndit Embed
<!--
This following lines should be placed at the location on your page where you would
like the punndit player to appear.
The data-punn-id attribute should be any value that will uniquely
identify the video you are attaching the punndit bar to.
For example if you were attaching the bar to a YouTube video
data-punn-id could be set to the URL of the YouTube video.
-->