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
-- | |
-- simple AppleScript to convert chosen AVI files to iPhone video format one by one using QuickTime Player X | |
-- | |
property outputFolder : (path to movies folder as Unicode text) | |
on check_exists(fileToCheck) | |
repeat | |
tell application "Finder" | |
if exists file fileToCheck then | |
exit repeat |
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
property extension_list : {"mp3"} | |
property destination_folder : (path to music folder as text) & "iTunes:iTunes Music:Automatically Add to iTunes:" | |
property this_action_path : (path to home folder as text) & "Library:Scripts:Folder Action Scripts:copy_to_itunes.scpt" | |
on adding folder items to this_folder after receiving added_items | |
set number_of_items to 0 | |
repeat with i from 1 to number of items in added_items | |
set this_file to item i of added_items | |
if folder of (info for this_file) is true then | |
tell application "System Events" |
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 *) | |
(* trim & validate selected text ^[a-zA-Z]+\-[0-9]+$ *) | |
(* change menu name to "Open [Selected issue id] in YouTrack" *) | |
(* multiple browsers support? *) | |
property theURL : "" | |
on run {input, parameters} | |
tell application "Google Chrome" | |
activate |
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 ($) { | |
/** | |
* Disposer jQuery plugin. | |
* | |
* Adds 'disposed' event so you may execute some code _before_ element is somehow removed: | |
* | |
* $('.remove').bind('disposed', function() { | |
* // code to be executed | |
* }); | |
* |
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
// usage: $.initinput(); $.inputmap("pressed LEFT", function() { alert('pressed LEFT') }, null); | |
// or: $('div').inputmap("pressed ESCAPE", function() { alert('pressed ESCAPE') }); | |
// with $.install_esc_handler() you popups will be closed by ESCAPE. Popups are elements with 'popup' class and 'z-index' > 0 | |
$.extend({ | |
keyCodes:{8:'BACKSPACE', 9:'TAB', 13:'ENTER', 16:'SHIFT', 17:'CONTROL', 18:'ALT', 27:'ESCAPE', | |
33:'PG_UP', 34:'PG_DN', 35:'END', 36:'HOME', 37:'LEFT', 38:'UP', 39:'RIGHT', 40:'DOWN', | |
46:'DELETE', 91:'META', 0:'UNKNOWN'}, | |
repeatKeys:[ 37, 38, 39, 40 ], |
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
// usage: _('#id.class1.class2[data-b=b]', 'test') -> <div id="id" class="class1 class2" data-b="b">test</div> | |
// or: _('a.link', {href: 'http://www.example.com'}, 'Click me') -> <a class="link" href="http://www.example.com">Click me</a> | |
_ = function(text, content_or_attrs, content) { | |
var result = "", id = false, cls = false, p = false, tag = false; | |
var b = ""; | |
for (var i = 0; i < text.length; i++) { | |
var ch = text.charAt(i); | |
if (ch == '#' && !p) { |
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
// simple observer (pubsub) implementation | |
define(["underscore", "base/classex", "util/logging"], function(_, Class, Logging) { | |
var PubSub = Class.extend({}); | |
PubSub._topics = function() { | |
if (!window.pubsub) { | |
window.pubsub = {}; | |
} | |
return window.pubsub; |
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
define(["class", "pubsub"], function(Class, Pubsub) { | |
var BrowserUtil = Class.extend({ | |
init: function() { | |
var blur = function onBlur() { | |
document.body.className = 'blurred'; | |
Pubsub.publish("window:blurred") | |
}; | |
var gain = function onFocus(){ | |
document.body.className = 'focused'; |
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
Upload.initDnD = function () { | |
var d = $(document)[0]; | |
d.ondragenter = function (event) { | |
event.preventDefault(); | |
if (!window.drag_in_progress) { | |
window.drag_in_progress = true; | |
var drop = $(h('.drop', h('.text', 'Drop it to upload'))); | |
$('body').append(drop); |
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
(ns ^{:doc "Clojure BSON Reader using Gloss + BSON Binary Search and Fast Document count" | |
:author "Alexey Pegov"} | |
bson.gloss | |
(:require [clojure.java.io :as io]) | |
(:use [gloss core io]) | |
(:import (java.nio BufferUnderflowException))) | |
; BSON string is a c-style string ended with a \0 | |
(def cstring (string :utf-8 :delimiters [0])) |
OlderNewer