Skip to content

Instantly share code, notes, and snippets.

View yoko's full-sized avatar
🍐
I like pear

yksk yoko

🍐
I like pear
View GitHub Profile
@yoko
yoko / Append to Notes.scpt.js
Last active March 21, 2020 18:59
BathyScaphe Script
// 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]
@yoko
yoko / likes.rb
Last active August 29, 2015 14:05
#!ruby
require "open-uri"
require "rubygems"
require "sequel"
require "tumblr_client"
require "mime/types"
blog = "example.tumblr.com"
path = "likes"
@yoko
yoko / pond.js
Created September 4, 2013 10:55
前回の返り値を引数に渡す関数
var counter = pond(function(count) {
return ++count;
}, 0);
counter(); // 1
counter(); // 2
var getValue = pond(function(value) {
return value ? value : calc();
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
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
ret = ""
ARGV[0].each_line do |line|
ret += "#{line.strip.sub(/^ +$/, '')}\n"
end
print ret.strip
var bind = function(context) {
$('.foo', context).foo();
...
};
$(function() {
bind();
$.get('/foo.html').done(function(html) {
html = $(html).appendTo('body');
Handlebars.registerHelper('equal', function(a, b, options) {
return a == b ?
options.fn(this) :
options.inverse(this);
});
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
@yoko
yoko / idea.js
Created April 24, 2012 04:53
アイデア思い付いたら書いてくところ
function foo(type) {
return type ?
function() {
return console.log(type);
} :
console.log(this.toString());
}
foo('foo')(); // コールバックで使う
foo.call('foo'); // 単独で使う