Skip to content

Instantly share code, notes, and snippets.

View caiogondim's full-sized avatar

Caio Gondim caiogondim

View GitHub Profile
@caiogondim
caiogondim / draw.js
Last active January 15, 2020 09:39
JavaScript native face detection
async function draw (canvas, video, overlay) {
window.requestAnimationFrame(() => draw(canvas, video, overlay))
const context = canvas.getContext('2d')
const videoCompStyle = window.getComputedStyle(video)
const videoWidth = videoCompStyle.width.replace('px', '')
const videoHeight = videoCompStyle.height.replace('px', '')
context.drawImage(video, 0, 0, videoWidth, videoHeight)
clearTimeout(hideTimeout)
if (faces.length) {
'use strict'
const _ = require('./underscore')
const Benchmark = require('benchmark')
const debug = require('logdown')()
// Current
function fibonacci(n) {
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2)
function isValidEmail(email) {
var input = document.createElement('input')
input.type = 'email'
input.value = email
return input.validity.valid
}
@caiogondim
caiogondim / index.js
Last active August 29, 2015 14:17
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Logdown = require('logdown')
var fooLogger = new Logdown({prefix: 'foo'})
fooLogger.log('Lorem')
fooLogger.info('Lorem')
fooLogger.warn('Lorem')
var barLogger = new Logdown({prefix: 'bar'})
@caiogondim
caiogondim / gist:9c61cdec4152fc7589df
Last active August 29, 2015 14:17
My dev configuration

Almir

  • 17/02/2013 Post Web Audio Hero: 19 heinekens / 0 pagas
  • 10/03/2013 Post Propagação de eventos em JS: 3 heinekens / 0 pagas

Caio

  • 10/02/2013 Post Eventos online e offline: 5 heinekens / 5 pagas
  • 03/03/2013 Post Console e command line API: 3 heinekens / 0 pagas
@caiogondim
caiogondim / wednerday.md
Created July 18, 2012 04:21 — forked from almirfilho/wednerday.md
Wednerday do Loop Infinito