Skip to content

Instantly share code, notes, and snippets.

@zillou
zillou / shuffle.js
Created June 6, 2013 06:32
A jQuery plugin shuffle DOM elements
(function($) {
$.fn.shuffle = function() {
var allElems = this.get(),
getRandom = function(max) {
return Math.floor(Math.random() * max);
},
shuffled = $.map(allElems, function() {
var random = getRandom(allElems.length),
randEl = $(allElems[random]).clone(true)[0];
allElems.splice(random, 1);
@zillou
zillou / vimrc
Created April 22, 2013 06:23
my vim config file
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
@zillou
zillou / nocaps.desktop
Created February 20, 2013 02:33
Remap caps lock as control
[Desktop Entry]
Encoding=UTF-8
Name=nocaps
Comment=Remap caps lock as control
Exec=setxkbmap -option ctrl:nocaps
Terminal=true
@zillou
zillou / cb.sh
Last active June 29, 2018 20:51
a wrapper function for xclip.
# A shortcut function that simplifies usage of xclip.
# - Accepts input from either stdin (pipe), or params.
# ------------------------------------------------
cb() {
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
# Check that xclip is installed.
if ! type xclip > /dev/null 2>&1; then
echo -e "$_wrn_col""You must have the 'xclip' program installed.\e[0m"
# Check user is not root (root doesn't have access to user xorg server)
elif [[ "$USER" == "root" ]]; then
public String toLowerCase(Locale locale) {
if (locale == null) {
throw new NullPointerException();
}
int firstUpper;
/* Now check if there are any characters that need to be changed. */
scan: {
for (firstUpper = 0 ; firstUpper < count; ) {