Skip to content

Instantly share code, notes, and snippets.

Avatar

Indamix Indamix

View GitHub Profile
View gist:1950114
function rgb2hex(r, g, b){
return (1 << 24 | r << 16 | g << 8 | b).toString(16).substr(1);
}
@Indamix
Indamix / gist:2226290
Created Mar 28, 2012
css 3d bended shadow
View gist:2226290
.bended-shadow {position:relative}
.bended-shadow::before, .bended-shadow::after {
content: '';
position: absolute;
width: 60%;
height: 20px;
-webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
-ms-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
@Indamix
Indamix / gist:2227793
Created Mar 28, 2012
get function code
View gist:2227793
function getCode(fn){
return fn.toString().replace(/^function.*?{|}$/g, '')
}
View bitwise for color.js
var hexToRgb = function(hex) {
hex = parseInt(hex, 16);
return [
(hex & 0xff0000) >> 16,
(hex & 0x00ff00) >> 8,
(hex & 0x0000ff)
];
};
var rgbToHex = function(r, g, b) {
View y-combinator.js
/*
const Y = (f) =>
( x => f(v => x(x)(v)) )(
x => f(v => x(x)(v))
);
*/
const Y = f => {
const something = x => f(v => x(x)(v));
return something(something);