Skip to content

Instantly share code, notes, and snippets.

@juli-so
juli-so / sc-dl.js
Last active August 29, 2015 14:25 — forked from pheuter/sc-dl.js
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
// ==UserScript==
// @name PopupBookmarkToolbar.uc.js
// @namespace http://d.hatena.ne.jp/Griever/
// @include main
// @version 0.0.3
// ==/UserScript==
(function(){
var mode = 'icons'; // 'icons', 'text' or 'full'
var size = 'small'; // 'small' or 'large'
// array of toolbar item id, 'separator', 'spring' and 'spacer'.
// ==UserScript==
// @name ChromeStyle_Statusbar.uc.js
// @namespace http://d.hatena.ne.jp/Griever/
// @include main
// ==/UserScript==
gBrowser.addEventListener("TabSelect", function(event){
var statusbar = document.getElementById("status-bar");
statusbar.hidden = true;
setTimeout(function(){
;;; Copy or Paste using one and the same key ("C-c c")
(defun copy-or-paste ()
"Copy when there are selected text, paste otherwise."
(interactive)
(if (region-active-p)
(copy-region-as-kill (region-beginning) ; Copy
(region-end))
;; TODO: deactive mark/region
;; Paste
;;; Copy or Paste using one and the same key ("C-c c")
(defun copy-or-paste ()
"Copy when there are selected text, paste otherwise."
(interactive)
(if (region-active-p)
(copy-region-as-kill (region-beginning) ; Copy
(region-end))
;; TODO: deactive mark/region
;; Paste
@juli-so
juli-so / copy-and-paste-one-key.el
Last active August 29, 2015 14:12 — forked from xuchunyang/copy-and-paste-one-key.el
如何实现 Ctrl+c 复制, Ctrl+c 粘帖 http://www.v2ex.com/t/158774#reply33
;;; Copy or Paste using one and the same key ("C-c c")
(defun copy-or-paste ()
"Copy when there are selected text, paste otherwise."
(interactive)
(if (region-active-p)
(copy-region-as-kill (region-beginning) ; Copy
(region-end))
;; TODO: deactive mark/region
;; Paste
@juli-so
juli-so / One-time Clipborad
Last active August 29, 2015 14:12 — forked from icylogic/One-time Clipborad
如何实现 Ctrl+c 复制, Ctrl+c 粘帖 http://www.v2ex.com/t/158774#reply34
#c::
if (Clipboard <> ""){
Send ^v
Clipboard :=""
} else {
Send ^c
}
Return