Skip to content

Instantly share code, notes, and snippets.

View carusog's full-sized avatar
📚
Learning something new

Giuseppe Caruso carusog

📚
Learning something new
View GitHub Profile
@carusog
carusog / shinywhitebox.js
Created December 29, 2012 15:26
How to delete default values in input fields on focus while keeping values typed by the user with jQuery
// Detetes default value in input fields but not user inserted text
default_values = {};
$email = $('input#email');
$email.each(function () {
var index = $(this).attr('name');
var value = $(this).val();
default_values[index] = value;
});
@carusog
carusog / gist:3736733
Created September 17, 2012 11:11
Switch between buffers using alt+left/right arrow in Vim
" Switch between buffers using alt+left/right arrow
nnoremap <silent><A-Right> :bn<CR>
inoremap <silent><A-Right> <C-O>:bn<CR>
nnoremap <silent><A-Left> :bp<CR>
inoremap <silent><A-Left> <C-O>:bp<CR>
@carusog
carusog / python_joke.py
Created August 26, 2012 16:33
Python joke
while True:
for i in ["/","-","|","\\","|"]:
print "%s\r" % i,
Time::DATE_FORMATS[:my_custom_time] = "%B %d, %Y"