Skip to content

Instantly share code, notes, and snippets.

$body
.append(welcome_dialog)
$#gist-live-welcome
.hide()
.center()
.gradient({
from: '003366'
,to: '333333'
#
# Logical inverter!
require 'rubygems'
require 'ruby2ruby'
class Sexp
def to_ruby
Ruby2Ruby.new.process(self)
end
function do_send() {
var method = [].shift.apply(arguments);
var payload = {id:id++, method: method, params:arguments};
socket.send(JSON.stringify(payload)+"\r\n");
}
_.tag_input
.keyup_size_to_fit();
.keybind('tab', edit_id)
.keybind('shift+3', edit_id)
.keybind('space', edit_id)
.keybind('shift+tab', edit_classes)
.keybind('.', edit_classes);
_.id_input
//oh...
if([].length > 0)
if([].length)
//DUH
eval (__DIR__+".irbrc").read if (__DIR__+".irbrc").exist?
_(textarea)
.keybind('ctrl+left', function() {
_(this).parent_node().parent_node().edit_in_place();
})
.keybind('ctrl+shift+left', function() {
var node = _(this).parent_node();
node.parent_node().before(node);
textarea.focus();
})
.keybind('ctrl+right', function() {
$('div').dblclick(function() {
var el = $(this);
el
.hide()
.after($('<input name="something" type="text">')
.val(el.html())
.blur(function() {
el
.html($(this).val())
.show();
<html>
<head>
<title>now... With jQuery</title>
<script src='javascripts/jquery-1.2.3.pack.js?'></script>
<script src='jquery.border_layout-0.0.0.js?'></script>
<style>
#document {
width: 250px;
background-color: pink; }
jQuery.fn.slider = function() {
var handle = this;
function drag_handler(e) {
// offset the mouse position half of the handles width
var pos = e.pageX;
var container = handle.siblings('.slider_bar');
var offset = container.offset()
pos = Math.min(Math.max(pos, offset.left), offset.left + container.width());