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
(defun web-reload-iphonesimulator () | |
"Reload a page on iPhone Simulator. Run process associated to the *Messages* buffer" | |
(interactive) | |
(start-process-shell-command | |
"iphonesimulator-process" | |
"*Messages*" | |
"osascript -e 'tell application \"System Events\"' -e 'tell process \"iPhone Simulator\"' -e 'click button \"Reload\" of window 1' -e 'end tell' -e 'end tell'")) |
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
tell application "System Events" | |
tell process "iPhone Simulator" | |
click button "Reload" of window 1 | |
end tell | |
end tell |
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
package me.tlync.android.util; | |
import android.util.Log; | |
/** | |
* Android Log wrapper class that can use {@link String#format(String, Object...)} in logging message | |
*/ | |
public class Logger { | |
private static final String TAG = Logger.class.getSimpleName(); |
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
(function($) { | |
var hasTouch = 'ontouchstart' in window; | |
/** | |
* @param {number} [amount=2] | |
* @param {string} [direction=both] both, h, v | |
*/ | |
$.fn.feedbackable = function(options){ | |
var settings = $.extend({ |
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
(function(){ | |
var hasTouch = 'ontouchstart' in window; | |
x$.extend({ | |
tap: function(fn, delay){ | |
// browser fallback | |
if(!hasTouch){ | |
return this.each(function(){ | |
x$(this).click(fn); |
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
// 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){ |
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
//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. | |
* |
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
(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] | |
*/ |
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
javascript:(function(){var p=[];for(var i in window){if(/webkit/i.test(i))p.push(i);}p.sort();alert(p.join('\n'));})(); |
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
;;; 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) |