Skip to content

Instantly share code, notes, and snippets.

View hanigamal's full-sized avatar
🎯
Focusing at office

Hani Gamal hanigamal

🎯
Focusing at office
View GitHub Profile
@hanigamal
hanigamal / nanoHTTPD
Created May 4, 2012 05:17
A simple, tiny, nicely embeddable HTTP 1.0 (partially 1.1) server in Java
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
@hanigamal
hanigamal / hextorgb.js
Created April 9, 2012 16:30
Convert a hex value to its decimal value
//Convert a hex value to its decimal value - the inputted hex must be in the
// format of a hex triplet - the kind we use for HTML colours. The function
// will return an array with three values.
function hex2num(hex) {
if(hex.charAt(0) == "#") hex = hex.slice(1); //Remove the '#' char - if there is one.
hex = hex.toUpperCase();
var hex_alphabets = "0123456789ABCDEF";
var value = new Array(3);
var k = 0;
var int1,int2;
@hanigamal
hanigamal / dabblet.css
Created February 25, 2012 04:23
CSS3 Cool 3-states Buttons
/**
* CSS3 Cool 3-states Buttons
*/
ul { list-style: none; }
a.button {
display: block;
float: left;
position: relative;
height: 25px;
width: 80px;
@hanigamal
hanigamal / internal-links.js
Created February 24, 2012 22:13
Smooth move to internal links
@hanigamal
hanigamal / dabblet.css
Created February 24, 2012 21:54
CSS Round Link Button
/**
* Round Link
*/
a.round:link, a.round:visited {
width: 140px;
color: #fff;
font: 28px/30px Arial;
text-transform: uppercase;
text-shadow: #6f0909 0 -1px 1px;
border: 1px solid #6F0909;