Skip to content

Instantly share code, notes, and snippets.

@YungSang
YungSang / gist:701118
Created November 15, 2010 22:53
[Deprecated] Revised "Post to Pip.io" Bookmarklet: escape -> encodeURIComponent to post UTF-8 characters correctly
javascript:void((function(){var%20u=location.href,e=encodeURIComponent,c='http://pip.io/api/posts/post/create',m=prompt('Post%20this%20link%20on%20Pip.io',document.title);if(m!=null){c+='?attachments=[{%22type%22:2,%22url%22:%22'+e(u)+'%22}]&body='+e(m)+'&targets=&channels=&cc=&cc_data=&source_id=0&source_type=1&is_public=1&reply_id=0';var%20w=window.open(c,'pipwin','height=1;width=1');setTimeout(function(){w.close();},2000);}})())
@YungSang
YungSang / pipio.js
Created December 10, 2010 00:31
[Deprecated] Pipio Plugin for Cortex
function Pipio() {
this.background = '#ffffff';
}
Pipio.prototype = new Service('Pipio');
Pipio.prototype.constructor = function() {
};
Pipio.prototype.authenticate = function(username, password, success, error) {
@YungSang
YungSang / youtube2srt.py
Created May 20, 2012 05:46
Convert a youtube transcript in srt subtitle (Python recipe)
#!/usr/bin/python
# -*- encoding:utf-8 -*-
"""Translate Google's Transcript into srt file.
Takes google's transcript filename as argument (xml extension required).
NB: to get google's transcript, use tihs URL:
http://video.google.com/timedtext?lang=en&v=VIDEO_ID
"""
Models.register({
name : 'LoveIt',
ICON : 'http://assets.loveit.com/assets/favicon.ico',
LINK : 'http://loveit.com/',
LOGIN_URL : 'http://loveit.com/me/login',
BOOKMARK_URL : 'http://loveit.com/loves/bookmarklet/create',
UPLOAD_URL : 'http://loveit.com/loves/upload/image',
POST_URL : 'http://loveit.com/loves/upload/create',
@YungSang
YungSang / utility.download.js
Created January 12, 2013 20:35
[Deprecated] Patch for Tombloo on Firefox 18 これを直接パッチディレクトリに突っ込んで再起動させるといいはず。 ※ この修正は Tombloo 0.4.33 で取り込まれました。
(function() {
addAround(grobal, 'download', function(proceed, args, self) {
try {
return proceed(args);
}
catch (e) {
return _download.apply(self, args);
}
});
@YungSang
YungSang / private.xml
Created January 20, 2013 00:54
The private.xml for KeyRemap4MacBook to remap Caps Lock to Hyper (Control + Shift + Option + Command). First, you need to disable Caps Lock through Keyboard Preference and remap Caps Lock to PC Application(keycode:110) using PCKeybaordHack.
<?xml version="1.0"?>
<root>
<item>
<name>Remap PC Application to Hyper</name>
<appendix>OS X doesn't have a Hyper. This maps PC Application to Control + Shift + Option + Command.</appendix>
<identifier>pc_application_to_hyper</identifier>
<autogen>
--KeyToKey--
@YungSang
YungSang / Gemfile
Created January 31, 2013 00:17
Gemfile for cucumber-chef v2.1.0.rc.5
source "https://rubygems.org"
gem "cucumber-chef", :git => "git://github.com/Atalanta/cucumber-chef", :tag => "v2.1.0.rc.5"
@YungSang
YungSang / Gemfile
Last active December 12, 2015 02:59
My procedure to use cucumber-chef v2.1.0.rc.6 with Vagrant
source "https://rubygems.org"
gem "cucumber-chef", :git => "git://github.com/Atalanta/cucumber-chef", :tag => "v2.1.0.rc.6"
@YungSang
YungSang / resume.scpt
Created February 23, 2013 12:37
Volume Control for LoginHook and LogoutHook
set myPath to (path to me)
tell application "Finder"
set myFolder to (container of myPath) as string
end tell
set volumeScriptPath to myFolder & "volume.scpt"
set volumeScript to load script file volumeScriptPath
set volume (theVolume of volumeScript)
@YungSang
YungSang / extractor.nicovideo.js
Last active December 16, 2015 18:09
[Deprecated] Taberareloo 用のニコニコ動画 Extractor この実装は推奨されません。こちらで対応されています。https://github.com/Constellation/taberareloo/pull/194
(function() {
update(Extractors['Video - Nico Nico Douga'], {
extract : function(ctx) {
var externalPlayerURL = 'http://ext.nicovideo.jp/thumb_' + ctx.pathname.slice(1) + '?thumb_mode=swf&ap=1&c=1';
var video_id = ctx.pathname.extract(/watch\/(sm\d+)/);
return request('http://ext.nicovideo.jp/api/getthumbinfo/' + video_id).addCallback(function(res) {
var xml = res.responseXML;
var status = xml.getElementsByTagName('nicovideo_thumb_response')[0].getAttribute('status');