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
// debugger | |
const BathyScaphe = Application('BathyScaphe') | |
const selectedText = BathyScaphe.documents[0].selectedText() | |
const threadTitle = BathyScaphe.documents[0].threadTitle() | |
const threadURL = BathyScaphe.documents[0].threadURL() | |
const Notes = Application('Notes') | |
const notes = Notes.defaultAccount.folders['📒Clipping'].notes | |
const note = notes[threadTitle] |
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
#!ruby | |
require "open-uri" | |
require "rubygems" | |
require "sequel" | |
require "tumblr_client" | |
require "mime/types" | |
blog = "example.tumblr.com" | |
path = "likes" |
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
var counter = pond(function(count) { | |
return ++count; | |
}, 0); | |
counter(); // 1 | |
counter(); // 2 | |
var getValue = pond(function(value) { | |
return value ? value : calc(); |
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
on run {input, parameters} | |
tell application "System Events" | |
set front_app to name of (path to frontmost application) | |
end tell | |
set page_url to false | |
if front_app is "Safari.app" then | |
tell application "Safari" | |
if windows is not equal to {} then | |
set page_url to URL of current tab of window 1 |
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
on run {input, parameters} | |
set AppleScript's text item delimiters to " | |
" | |
set input_text to input as text | |
tell application "Safari" | |
set page_url to URL of current tab of window 1 | |
set page_title to name of current tab of window 1 | |
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
ret = "" | |
ARGV[0].each_line do |line| | |
ret += "#{line.strip.sub(/^ +$/, '')}\n" | |
end | |
print ret.strip |
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
var bind = function(context) { | |
$('.foo', context).foo(); | |
... | |
}; | |
$(function() { | |
bind(); | |
$.get('/foo.html').done(function(html) { | |
html = $(html).appendTo('body'); |
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
Handlebars.registerHelper('equal', function(a, b, options) { | |
return a == b ? | |
options.fn(this) : | |
options.inverse(this); | |
}); |
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
on growl(str) | |
try | |
do shell script "/usr/local/bin/growlnotify -a BathyScaphe -t \"Send to Evernote\" -m " & quoted form of str | |
end try | |
end growl | |
tell application "BathyScaphe" | |
set selected_text to selected text of document 1 | |
set thread_title to thread title of document 1 |
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 foo(type) { | |
return type ? | |
function() { | |
return console.log(type); | |
} : | |
console.log(this.toString()); | |
} | |
foo('foo')(); // コールバックで使う | |
foo.call('foo'); // 単独で使う |
NewerOlder