Skip to content

Instantly share code, notes, and snippets.

View aL3xa's full-sized avatar

Aleksandar Blagotić aL3xa

View GitHub Profile
#!/bin/bash
# Generar un script para vegnuxmod (roms para firefox os) que permita la automatización
# en las compilaciones de los diferentes "branches" o ramas utilizando las mismas fuentes git
# evitando la redundancia de código, en esta primera versión se manejarán las siguientes versiones.
# v1.4, v2.0 y master
#
# Se describirá a continuación paso por paso los procedimientos que se deben seguir para preparar
# el código fuente segun la rama git.
#
#############
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)$/,
@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))
@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))
/* -*- Mode: Text; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Solarized.
* see output-base.css for details.
*/
@aL3xa
aL3xa / sweave.sh
Created July 26, 2013 18:29
Sweave script inspired by Dirk Eddelbuettel's answer on StackOverflow: http://stackoverflow.com/questions/2940756/ess-auctex-sweave-integration
#!/bin/bash
FILEBASE=${1%.*}
FILEXT=${1##*.}
FILEPATH=${1%/*}
TEXFILE=$FILEBASE.tex
PDFFILE=$FILEBASE.pdf
# errorexit
@noreiller
noreiller / backup-full.sh
Last active January 4, 2016 16:30
Geeksphone Peak backup scripts
#!/bin/sh
BACKUP_DATE=`date +%Y-%m-%d_%H-%M-%S`
BACKUP_DIR="~/PEAK/BACKUPS/$BACKUP_DATE"
mkdir -p "$BACKUP_DIR"
cd "$BACKUP_DIR"
sudo adb pull /data/local/storage/persistent/
// サジェスト付き検索
// 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);
@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!"
@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 = {}