Skip to content

Instantly share code, notes, and snippets.

@casaval
casaval / postreceive.php
Created June 15, 2012 18:13
Github WebHook processor
<?php
/**
* Github WebHook processor
* POST to: postreceive.php?key=REPLACE_ME_WITH_A_UNIQUE_KEY
*
* @author Luis Abreu
* @version 0.1
* @copyright Quodis, 24 February, 2011
* @package default
@casaval
casaval / kb.c
Created December 5, 2012 19:45 — forked from randrews/kb.c
Lua getch extension
/* Build me with:
gcc -shared -o kb.so -undefined dynamic_lookup kb.c -lncurses
*/
/* Copyright (C) 2012 Ross Andrews
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
@casaval
casaval / gist:6274691
Created August 19, 2013 22:01
Parsely.js add server side error checks on submit
$(this.content).find("form").parsley('addListener',{
onFormSubmit:function(isFormValid, event, parsleyForm){
event.preventDefault();
if(isFormValid) {
$.post('/video/vote', parsleyForm.$element.serialize(), function(data) {
if(data.message === 'success') {
} else {
}
console.log('message: ' + data.message);
});
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@casaval
casaval / gist:61b9808c90716ed6407f
Created June 24, 2014 04:58
Install love2d 0.9.1 on crunchbang debian wheezy
#step 1: install SDL
hg clone http://hg.libsdl.org/SDL
cd SDL
../configure
make [-j 4]
sudo make install

CrunchBang 11: Remap Caps Lock to CTRL

$ vim ~/.Xmodmap

remove Lock = Caps_Lock
remove Control = Control_L
keysym Caps_Lock = Control_L
add Control = Control_L
Follow these steps
============
1) Create a folder on local disk Eg: C:\Users\keerthip\Documents\Dropbox
2) Create a Drive Letter Mapping eg:(H:) to the folder path in windows with following command
subst H: C:\Users\keerthip\Documents\Dropbox
3) Install Dropbox desktop software in advanced Mode.
Select the new local drive H: and sync either selective folders or all folder to local drive ( which is original folder path)
4) Wait till content is fully synced from web account
5) Pause Syncing and Exit Dropbox
6) Delete local folder drive mapping with following command
@casaval
casaval / bling.js
Last active August 29, 2015 14:23 — forked from paulirish/bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document)
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn)
}
NodeList.prototype.__proto__ = Array.prototype
@casaval
casaval / starter.lua
Created August 31, 2016 08:03 — forked from byronhulcher/starter.lua
PICO-8 Starter LUA code (save this as starter.p8)
-- pico-8 starter code
-- by @hypirlink
-- _init() is called when
-- you 'run' the program
function _init()
-- states: menu, game, end
state = "menu"
end

Keybase proof

I hereby claim:

  • I am casaval on github.
  • I am casaval (https://keybase.io/casaval) on keybase.
  • I have a public key whose fingerprint is 8D24 51FA 3F2B 2C52 6E8A FE3E D1FE C1D7 D592 6CE6

To claim this, I am signing this object: