Skip to content

Instantly share code, notes, and snippets.

View alvinfrancis's full-sized avatar

Alvin Francis Dumalus alvinfrancis

View GitHub Profile
@alvinfrancis
alvinfrancis / sqlformat.vim
Last active December 19, 2015 17:28
Simple VimL-Python script that uses sqlformat.org to format the selected string
" format SQL using sqlformat.org
function! SQLFormat() " {{{
'<,'>python << EOF
import vim
import urllib2, urllib, json
sql = ' '.join(vim.current.range)
params = {'sql': sql,
'n_indents': 4,
'keyword_case': 'upper',
'reindent': 1}
@alvinfrancis
alvinfrancis / tmux-newsbeuter-open.sh
Created August 1, 2013 10:44
newsbeuter open browser script in tmux
#!/bin/sh
shellbrowser='elinks'
tmux_current_window=`tmux display-message -p "#W"`
tmux_current_pane=`tmux display-message -p "#P"`
# Check if in the right tmux window
if [ $tmux_current_window != 'news' ];then
elinks $1
exit 0
# Default prefex C-b is kept
set -g default-terminal "screen-256color-italic"
# Keep quiet
set -g quiet on
# Set window notifications
setw -g monitor-activity on
@alvinfrancis
alvinfrancis / simple-vanilla-vim-powerline.vim
Last active December 20, 2015 12:29
Very Vanilla Vim Powerline
" Very Vanilla Powerline
function! GetMode() " {{{
let mode = mode()
if mode ==# 'v'
let mode = "VISUAL"
elseif mode ==# 'V'
let mode = "V.LINE"
elseif mode ==# ' '
let mode = "V.BLOCK"
# change some default settings
browser "tmux-newsbeuter-open.sh %u"
always-display-description true
auto-reload yes
feed-sort-order unreadarticlecount-asc
notify-xterm yes
notify-screen yes
notify-beep yes
refresh-on-startup yes
@alvinfrancis
alvinfrancis / urls
Created October 7, 2013 01:12
feeds
http://blog.sanctum.geek.nz/feed/
https://news.ycombinator.com/rss
http://jeremykun.wordpress.com/feed/
http://www.giantitp.com/comics/comics.rss
http://kmandla.wordpress.com/feed/
http://inconsolation.wordpress.com/feed/
http://onethingwell.org/rss
http://what-if.xkcd.com/feed.atom
http://lucumr.pocoo.org/feed.atom
http://syndication.thedailywtf.com/TheDailyWtf
@alvinfrancis
alvinfrancis / retrogames.lisp
Created January 19, 2014 15:17
Code for the Lisp for the Web tutorial by Adam Thornhill
(defmethod vote-for (user-selected-game)
(incf (votes user-selected-game)))
;;;; A prototypic backend
(defvar *games* '())
(defun game-from-name (name)
(find name *games*
@alvinfrancis
alvinfrancis / profiles.clj
Created August 27, 2014 03:33
Clojurescript dev profile for browser-repl with Austin
{:shared {:clean-targets ["out" :target-path]}
:dev [:shared
{:resources-paths ["dev-resources"]
:source-paths ["dev-resources/tools/repl"]
:plugins [[com.cemerick/austin "0.1.4"]]
:injections [(require 'cemerick.austin.repls)
(defn browser-repl-env []
@alvinfrancis
alvinfrancis / bubbleberry-theme.el
Created October 27, 2014 04:13
Modified bubbleberry-theme.el
;;; bubbleberry-theme.el --- A theme based on LightTable for Emacs24
;;; Author: Jason Milkins <jasonm23@gmail.com>
;; Gaurav Giri github.com/grvgr
;;; Url: https://github.com/jasonm23/emacs-bubbleberry-theme
;; Version: 20131223.349
;;; X-Original-Version: 0.1.2
;;; Package-Requires: ((emacs "24.1"))
;;;
;;; Change Log:
;;