Skip to content

Instantly share code, notes, and snippets.

;;; js-beautify.el -- beautify some js code
(defgroup js-beautify nil
"Use jsbeautify to beautify some js"
:group 'editing)
(defcustom js-beautify-args "--jslint-happy --brace-style=end-expand --keep-array-indentation"
"Arguments to pass to jsbeautify script"
:type '(string)
:group 'js-beautify)
@tlync
tlync / js-beautify.el
Created May 11, 2011 08:33 — forked from slackorama/js-beautify.el
beautify some js code in emacs
;;; js-beautify.el -- beautify some js code
(defgroup js-beautify nil
"Use jsbeautify to beautify some js"
:group 'editing)
(defcustom js-beautify-args "--jslint-happy --brace-style=end-expand --keep-array-indentation"
"Arguments to pass to jsbeautify script"
:type '(string)
:group 'js-beautify)
-- Things to Pomodoro App for iPad
-- This script asks Things for the currently selected todos
-- and generates a Pomodoro App for iPad compatible JSON file
-- for you to import in to the app (using Dropbox)
--
-- Created by Thomas on 2011-02-17
-- Inspired by Andreas on 2011-02-17
--
-- OmniFocus (or many other apps) to Pomodoro App for iPad
-- This script practically takes text that's on your clipboard
-- and generates a Pomodoro App for iPad compatible JSON file
-- to import into the app. (using Dropbox)
--
-- I'm using it with OmniFocus, where copied tasks remain
-- on the clipboard as lines of text, basically.
--
-- Created by Andreas on 2011-02-17
-- http://www.macosxscreencasts.com
@tlync
tlync / gist:988407
Created May 24, 2011 09:16
bookmarklet: list webkit properties
javascript:(function(){var p=[];for(var i in window){if(/webkit/i.test(i))p.push(i);}p.sort();alert(p.join('\n'));})();
@tlync
tlync / jquery-outer.js
Created June 9, 2011 05:01
jquery outer width/height plugin - Set the outer width/height of each element in the set of matched elements.
//TODO: refactoring
(function($){
var origOuterWidth = $.fn.outerWidth,
origOuterHeight = $.fn.outerHeight;
/**
* Get the current outer width for the first element in the set of matched elements.
* or set the outer width of each element in the set of matched elements.
*
@tlync
tlync / jquery-doubletap.js
Created June 9, 2011 03:45
jquery double tap plugin - Bind an event handler to the "double tap" JavaScript event.
(function($){
var hasTouch = /android|iphone|ipad/i.test(navigator.userAgent.toLowerCase()),
eventName = hasTouch ? 'touchend' : 'click';
/**
* Bind an event handler to the "double tap" JavaScript event.
* @param {function} doubleTapHandler
* @param {number} [delay=300]
*/
@tlync
tlync / haml2html.js
Created September 5, 2011 07:57
Haml to html in realtime
// usege: node haml2html <file>
var sys = require('util'),
fs = require('fs'),
http = require('http'),
exec = require('child_process').exec
var argv = process.argv,
target = argv[2]
if(!target){
@tlync
tlync / jquery-feedbackable.js
Created October 14, 2011 10:21
jquery-feedbackable.js
(function($) {
var hasTouch = 'ontouchstart' in window;
/**
* @param {number} [amount=2]
* @param {string} [direction=both] both, h, v
*/
$.fn.feedbackable = function(options){
var settings = $.extend({
@tlync
tlync / xui-tap.js
Created October 14, 2011 10:17
tap for xui
(function(){
var hasTouch = 'ontouchstart' in window;
x$.extend({
tap: function(fn, delay){
// browser fallback
if(!hasTouch){
return this.each(function(){
x$(this).click(fn);