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.
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

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
@casaval
casaval / normalize-to-string.js
Created February 9, 2017 22:41 — forked from tracker1/normalize-to-string.js
prehash password
export default function normalizeToString(input) {
// string or String object
if (typeof input === 'string' || input instanceof String) return input.toString();
// boolean value
if (typeof input === 'boolean') return input.toString();
// numeric value
if (typeof input === 'number' || input instanceof Number) {
// not a finite value - invalid input - return empty
@casaval
casaval / guide.md
Created December 17, 2020 18:10 — forked from jacopocolo/guide.md
Making a Bitsy game compatible with the Nintendo 3ds browser

The Nintendo 3ds browser is capable of running Bitsy games! And it's a delightful Bitsy machine.

To make games compatible, we just need to teach the 3ds browser to speak the language Bitsy is written in: modern Javascript!

To do that we need two things:

  1. The html page that contains your game
  2. A <script> </script> html element we'll add at the top of the page that translates modern Javascript to somewhat Javascript.

The whole script element is here. Just select the whole thing and copy.

@casaval
casaval / free-3-letter-domains.sh
Created February 1, 2022 18:12 — forked from rudolfschmidt/free-3-letter-domains.sh
Check Free 3 Letter Domains
#!/usr/bin/env bash
array=( a b c d e f g h i j k l m n o p q r s t u v w x y z )
for a in "${array[@]}"
do
for b in "${array[@]}"
do
for c in "${array[@]}"
do