Skip to content

Instantly share code, notes, and snippets.

#import "NSString+template.h"
@implementation NSString (template)
+(NSString*)stringWithTemplate:(NSString*)template
fromMap:(NSDictionary*)map
{
NSString* retStr = nil;
NSMutableString* buffer = [NSMutableString new];
NSScanner* scanner = [[NSScanner alloc] initWithString:template];
*filter
# RH0
-A INPUT -m rt --rt-type 0 -j DROP
-A FORWARD -m rt --rt-type 0 -j DROP
-A OUTPUT -m rt --rt-type 0 -j DROP
# Allow all loopback (lo0) traffic and drop all traffic to ::1 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -d ::1 -j REJECT
@raymondjavaxx
raymondjavaxx / open.bat
Created September 17, 2012 03:49
Open command for Windows
@ECHO off
IF "%*" == "" GOTO open_current
explorer %*
GOTO :end
:open_current
explorer .
:end
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
@raymondjavaxx
raymondjavaxx / es.sh
Created August 30, 2012 19:51
Install ElasticSearch on Ubuntu 12.04
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@raymondjavaxx
raymondjavaxx / food.md
Created August 6, 2012 18:52
SOHO Food

ASIAN

  • mooncake
  • 35 (thai)
  • thai angel (not as good as 35; no reason to ever go here)
  • peep
  • excellent dumpling house
  • vietnamese sammy spot
  • bun
  • the bomb pho spot
  • veggie chinese spot
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
<?php
require_once('/home/superjug/public_html/foro/SSI.php');
global $context, $scripturl, $user_info;
?>
<?php
if ($context['user']['is_guest']) {
ssi_login();
ssi_welcome();
} else {

Using the latest Chrome Beta (11.0.696.16 beta) and the new HTML5 Speech Input features, we can jump into the future with Wolfram|Alpha.

Make a bookmark with the code below as the source.

javascript:(function(){javascript:input=$('input');
['','webkit','x-webkit-'].map(function(prefix){input.attr(prefix+'speech','').bind(prefix+'speechchange',
function(e){$('form:first').submit()})})})();

Navigate to Wolfram|Alpha, click the bookmark.

<html>
<head>
<script src='http://code.jquery.com/jquery-1.4.2.min.js'></script>
<script src='http://jquery-flickr.googlecode.com/files/jquery.flickr-1.0-min.js'></script>
<script src='http://desandro.com/demo/masonry/js/jquery.masonry.js'></script>
<script src='http://plugins.jquery.com/files/jquery.md5.js.txt'></script>
<script src='http://github.com/xaviershay/jquery-enumerable/raw/master/jquery.enumerable.js'></script>
<link rel="stylesheet" type="text/css" href="http://desandro.com/demo/masonry/css/masonry-example.css" media="screen" charset="utf-8" />
<script>