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
// サジェスト付き検索 | |
// Google, Wikipedia などが使用可能 | |
// s を入力するとエンジン選択画面が開く。 j/k で上下へ。 Enter や s で決定。 | |
// エンジンを決定したら検索語句を入力する画面へ。ここで文字を入力して TAB を押すとサジェストの結果で補完される。 | |
key.setViewKey('s', function (ev, arg) { | |
let engines = util.suggest.getEngines(); | |
// If you want to use all available suggest engines, | |
// change suggestEngines value to util.suggest.filterEngines(engines); |
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
key.setViewKey('o', function (aEvent) { | |
prompt.reader( | |
{ | |
message : "Find file:", | |
group : "find-file", | |
flags : [ICON | IGNORE, 0], | |
completer : completer.fetch.directory( | |
{ | |
// hideDotFiles : true, | |
// mask : /\.(js|jpg|jpeg)$/, |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
#!/usr/bin/ruby | |
# Pulseaudio volume control | |
class Pulse | |
attr_reader :volumes, :mutes | |
# Constructor | |
def initialize | |
dump = `pacmd dump`.lines | |
@volumes = {} |
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
RVM home page: http://rvm.beginrescueend.com | |
Install RVM | |
------------ | |
See http://rvm.beginrescueend.com/rvm/install/ | |
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) | |
Install rvm for all users |
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
javascript:(function(){div=document.createElement('div');e=document.createElement('g:plusone');div.style.position='fixed';div.style.bottom='8px';div.style.right='8px';div.appendChild(e);document.body.appendChild(div);e=window.document.createElement('script');e.setAttribute('src','https://apis.google.com/js/plusone.js');document.body.appendChild(e);})(); |
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
;;; support for 'brew' as a mixture of R and HTML | |
(load-file "~/.emacs.d/multi-mode.el") | |
(load-file "~/.emacs.d/html-brew.el") | |
(add-to-list 'auto-mode-alist '("\\.brew\\'" . html-brew-mode)) |
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
-- pomodoro timer widget | |
pomodoro = {} | |
-- tweak these values in seconds to your liking | |
pomodoro.pause_duration = 300 | |
pomodoro.work_duration = 1200 | |
pomodoro.pause_title = "Pause finished." | |
pomodoro.pause_text = "Get back to work!" | |
pomodoro.work_title = "Pomodoro finished." | |
pomodoro.work_text = "Time for a pause!" |
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
(defun ess-build-and-load-package () | |
"Builds R pkg in current project and (re)loads it in R session." | |
(interactive) | |
(setq curbuf (current-buffer)) | |
(setq w1 (selected-window)) | |
(setq w1name (buffer-name)) | |
(setq tmpbuf (get-buffer-create "*pkg build*")) | |
(setq w2 (split-window-horizontally)) | |
(shell-command (format "~/.emacs.d/build-R-pkg.sh %s" eproject-root) tmpbuf ) | |
(ess-command (format "pkg.path <- \"%s\";pkg.name <- readLines(file.path(pkg.path, 'DESCRIPTION'));pkg.name <- strsplit(pkg.name[grepl('Package: ', pkg.name)], ' ')[[1]][2];pkg.ns <- paste0('package:', pkg.name);if (!is.na(match(pkg.ns, search()))){detach(pkg.ns, character.only = TRUE)};library(pkg.name, character.only = TRUE, unload = TRUE)\n" eproject-root)) |
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
/** | |
* How to have floating scrollbars in Firefox (Linux, Windows & Mac). | |
* Screenshot: http://i.imgur.com/bn44L.png | |
* You need Firefox > 18. Just run this code in a browser-scratchpad: | |
* | |
* Ping me on Twitter (@paulrouget) if you run into problems. | |
* | |
* 1. Go to about:config - Set devtools.chrome.enabled to true | |
* 2. Starts Scratchpad (Shift-F4) | |
* 3. In Scratchpad's menubar, check "Environment > Browser" |
OlderNewer