This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["convert"], | |
description: "Converts markdown text to html.", | |
help: "Select markdown text, hit enter to replace with converted html.", | |
author: {name: "Jethro Larson", email: "[email protected]"}, | |
license: "BSD", | |
homepage: "http://gist.github.com/21974", | |
arguments: [ | |
{role: 'object', nountype: noun_arb_text,label:"markdown"}, | |
{role:'goal',nountype:noun_arb_text, label:"html"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "hex-to-decimal", | |
icon: "", | |
homepage: "http://gist.github.com/gists/50159", | |
author: { name: "Jethro Larson", email: "[email protected]"}, | |
license: "GPL", | |
description: "Convert Hexidecimal Integer to Decimal", | |
help: "Enter a Hexidecimal number", | |
takes: {"Hex": noun_arb_text}, | |
_toDec: function(Hex){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "decimal-to-hex", | |
icon: "", | |
homepage: "http://jethro-larson.appspot.com", | |
author: { name: "Jethro Larson", email: "[email protected]"}, | |
license: "GPL", | |
description: "Convert Decimal Integer to Hex", | |
help: "Enter a Decimal number", | |
takes: {"Decimal": noun_arb_text}, | |
_toDec: function(Decimal){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This is just a port of Arc90's Readibility bookmarklet | |
Props goes to them. | |
- Jethro Larson | |
*/ | |
jetpack.statusBar.append({ | |
html: <> | |
<div id="read">Readibility</div> | |
</>, | |
width: 70, | |
onReady: function(widget){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Turn any function into a jQuery method | |
$.plug = function(name,func){ | |
$[name]=func; | |
}; | |
//: Turn any function into a jQuery plugin | |
$.fnPlug = function(name,func){ | |
$.fn[name] = function(){ | |
var args = arguments; | |
return self.each(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.pollute = function (pollution) { | |
pollutants = { | |
air:"SMOAK", | |
water:"OIL", | |
noise:"BLAH" | |
} | |
window.emit = function(type) { | |
var i = Math.round(Math.random()*1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Write a function that walks the entire dom of a page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//given huge array of strings return array containing the duplicates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.balls = function(){ | |
return this.each(function(){ | |
var $this = $(this), | |
w = $this.width(), | |
h = $this.height(), | |
max = w > h ? w : h, | |
rad = Math.floor(max/2) + "px"; | |
$this.css({ | |
"width": max, | |
"height": max, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.c = function(className){ | |
return typeof document.getElementsByClassName === "function" | |
? $(document.getElementsByClassName(className)) : $('.'+className); | |
}; | |
//In some brief tests I saw greater than 50% increase in speed for classNames. | |
$.q = function(sel){ | |
return typeof document.querySelectorAll === "function" | |
? $(document.querySelectorAll(sel)) : $(sel); |
OlderNewer