Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
hey ✌🏼

Davidson Fellipe davidsonfellipe

:octocat:
hey ✌🏼
View GitHub Profile
View gist:5457768
var Canvas = function(canvas){
this.canvas = canvas;
this.ctx = canvas.getContext('2d');
this.imageData = this.ctx.getImageData(0, 0, canvas.width, canvas.height);
this.data = this.imageData.data;
};
View gist:5670524
function colorCIEXYZtosRGB(XYZ) {
var RGBTEMP = {R:0,
G:0,
B:0};
RGBTEMP.R = 3.2404542 * XYZ.X - 1.5371385 * XYZ.Y - 0.4985314 * XYZ.Z;
RGBTEMP.G =-0.9692660 * XYZ.X + 1.8760108 * XYZ.Y + 0.0415560 * XYZ.Z;
RGBTEMP.B = 0.0556434 * XYZ.X - 0.2040259 * XYZ.Y + 1.0572252 * XYZ.Z;
View gist:5670604
function xyz_from_wavelength (ColorTemp, lw, currentCIE) {
var nmMin = 380;
var nmMax = 780;
var degrees = 5;
var XYZ = {x: 0,
y: 0,
z: 0};
@davidsonfellipe
davidsonfellipe / imgToCanvas.js
Last active Dec 18, 2015
Converter image to canvas, using on LenaJS
View imgToCanvas.js
//Método do LenaJS que converte uma imagem para o tipo ImageData
LenaJS.getImage = function(img) {
var c = document.createElement('canvas');
c.width = img.width;
c.height = img.height;
var ctx = c.getContext('2d');
ctx.drawImage(img, 0, 0);
View lenajs.grayscale.js
LenaJS.grayscale = function(pixels, args) {
for (var i = 0; i < pixels.data.length; i += 4) {
var r = pixels.data[i],
g = pixels.data[i+1],
b = pixels.data[i+2];
pixels.data[i] = pixels.data[i+1] = pixels.data[i+2] = 0.2126*r + 0.7152*g + 0.0722*b;
View str.go
package str
func Reverse(input string) string {
inputLength := len(input)
inverted := make([]rune, inputLength)
for _, char := range input {
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
View gist:6764486
"Use Vim settings, rather then Vi settings (much better!).
"This must be first, because it changes other options as a side effect.
set nocompatible
let mapleader=","
"fonts and other gui stuff
"make sure to install the powerline patched font
"version of the font you like
"https://github.com/Lokaltog/powerline-fonts
View gist:6902968
//CSS3 new properties for background: background-size, background-origin and background-clip, new shorthand:
.selector {
background: #000 url(image.gif) no-repeat top left / 100% 100% border-box content-box;
// COLOR URL REPEAT POSITION-TOP POSITION-LEFT / BACKGROUND-SIZE-WIDTH BACKGROUND-SIZE-HEIGHT BACKGROUND-ORIGIN BACKGROUND-CLIP
}
@davidsonfellipe
davidsonfellipe / gist:7515312
Created Nov 17, 2013
Sugestão para boxes GE-UI
View gist:7515312
%franja {
position: relative;
&:before {
content: "";
border-style: none none none solid;
border-width: 0 0 0 80px;
bottom: -1px;
clear: both;
color: #B60D3D;
You can’t perform that action at this time.