Skip to content

Instantly share code, notes, and snippets.

View aL3xa's full-sized avatar

Aleksandar Blagotić aL3xa

View GitHub Profile
// サジェスト付き検索
// 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);
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)$/,
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=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')
@jaspervdj
jaspervdj / volume.rb
Created February 7, 2011 16:17
Set pulseaudio volume from the command line
#!/usr/bin/ruby
# Pulseaudio volume control
class Pulse
attr_reader :volumes, :mutes
# Constructor
def initialize
dump = `pacmd dump`.lines
@volumes = {}
@fajrif
fajrif / rvm_cheatsheet
Created June 14, 2011 14:11
RVM cheatsheet
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
@ybart
ybart / gist:1070803
Created July 7, 2011 23:42
Google +1 Bookmarklet (Bottom Right)
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);})();
@floybix
floybix / .emacs
Created July 20, 2011 13:05
Emacs support for R embedded in HTML (using brew R package)
;;; 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))
@nistude
nistude / pomodoro.lua
Created August 19, 2011 14:30
Pomodoro Timer Widget for the Awesome Window Manager
-- 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!"
@daroczig
daroczig / .emacs
Created April 20, 2012 14:39
Building and (re)loading packages with a keypress in Emacs
(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))
@paulrouget
paulrouget / scratchpad.js
Created November 2, 2012 17:59
Floating scrollbars in Firefox
/**
* 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"