I hereby claim:
- I am hoffrocket on github.
- I am hoff (https://keybase.io/hoff) on keybase.
- I have a public key whose fingerprint is A4AB A02A 4F21 DA7D B7EC E7BC 8BFD 1D7C 2B6E E597
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User | |
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User | |
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User | |
[ | |
{ | |
"button": "button1", | |
"count": 1, | |
"modifiers": ["super"], | |
"press_command": "drag_select", |
class BinaryTree[A <% Ordered[A]]private (datum: A,less: Option[BinaryTree[A]],more: Option[BinaryTree[A]]) { | |
def this(datum: A) = this(datum, None,None) | |
def add(a: A):BinaryTree[A] = { | |
def addTo(branch: Option[BinaryTree[A]]) = Some(branch.map(_.add(a)).getOrElse(new BinaryTree(a))) | |
if (a <= datum) | |
new BinaryTree(datum, addTo(less), more) |
case class Tree[A](datum:A, children:List[Tree[A]]) { | |
def map[B](fn: A => B): Tree[B] = { | |
new Tree[B](fn(datum),children.map(_.map(fn))) | |
} | |
def foreach(fn: A => Unit) { | |
fn(datum) | |
children.foreach(_.foreach(fn)) | |
} | |
require 'rubygems' | |
require 'twitter' | |
require 'mechanize' | |
consumer_token = 'token' | |
consumer_secret = 'secret' | |
twitter_name = ARGV[0] | |
twitter_password = ARGV[1] |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> | |
<head> | |
<title>foo</title> | |
</head> | |
<body style="overflow:hidden"> | |
<div id="FB_HiddenIFrameContainer" style="display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;"></div> | |
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> |
function profilePic(selector, id){ | |
var element = $j(selector); | |
var oldId = element.attr('uid'); | |
if (oldId != id){ | |
element.attr('uid',id); | |
FB.XFBML.Host.addElement(new FB.XFBML.ProfilePic(element.get(0))); | |
} | |
} |
package hoffrocket | |
import _root_.net.liftweb.mapper._ | |
import _root_.java.sql.{PreparedStatement,Types, Connection,DriverManager} | |
import scala.collection.mutable.HashMap | |
import _root_.net.liftweb.util._ | |
import Helpers._ | |
/** |
case class MySetHtml(uid:String, xhtml:NodeSeq) extends JsCmd { | |
def filterScripts(xhtml:NodeSeq):(String, NodeSeq) = { | |
def xform(in: NodeSeq): NodeSeq = in flatMap { | |
case e: Elem if e.label == "script" => NodeSeq.Empty | |
case e: Elem => Elem(e.prefix, e.label, e.attributes, e.scope, xform(e.child) :_*) | |
case g: Group => xform(g.child) | |
case x => x | |
} |
trait ScriptFilter extends JsCmd { | |
def content:NodeSeq | |
override def fixHtml(uid: String, content: NodeSeq): String = { | |
def xform(in: NodeSeq): NodeSeq = in flatMap { | |
case e: Elem if e.label == "script" => NodeSeq.Empty | |
case e: Elem => Elem(e.prefix, e.label, e.attributes, e.scope, xform(e.child) :_*) | |
case g: Group => xform(g.child) | |
case x => x |