Skip to content

Instantly share code, notes, and snippets.

Avatar

Anibal anaibol

View GitHub Profile
@anaibol
anaibol / array-find.js
Created Aug 20, 2017
Minimal Array.find polyfill
View array-find.js
if (!Array.prototype.find) {
Array.prototype.find = function (predicate) {
return this.filter(predicate)[0]
}
}
@anaibol
anaibol / ImageTools.js
Last active Nov 8, 2016 — forked from dcollien/ImageTools.es6
Resize Images in the Browser, returns a Promise
View ImageTools.js
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () {
try {
return Boolean(new Blob());
} catch (e) {
return false
}
}())
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () {
try {
View debounce.js
export default function debounce(func, wait, immediate) {
let timeout
return function(...args) {
clearTimeout(timeout)
timeout = setTimeout(() => {
timeout = null
if (!immediate) func.apply(this, args)
}, wait)
if (immediate && !timeout) func.apply(this, [...args])
}
View docker-compose.yml
node:
image: "mhart/alpine-node:5.9.1"
redis:
image: "redis:3.0.7-alpine"
app:
build: app
api:
build: api
View gist:69e178356975fb1bb0d2
<a href={data.link} target="_blank" className="image">
<span className="tag">ZG Instagram</span>
<img className="image" src={data.images.standard_resolution.url} width="100%" height="100%" />
</a>
View gist:2eaea0dcbcc7e0df42c8
<a href={data.link} target="_blank" className="image">
<span className="tag">ZG Instagram</span>
<img className="image" src={data.images.standard_resolution.url} width="100%" height="100%" />
</a>
@anaibol
anaibol / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View scala.rb
require 'formula'
class ScalaDocs < Formula
homepage 'http://www.scala-lang.org/'
url 'http://www.scala-lang.org/downloads/distrib/files/scala-docs-2.9.3.zip'
sha1 '633a31ca2eb87ce5b31b4f963bdfd1d4157282ad'
end
class ScalaCompletion < Formula
homepage 'http://www.scala-lang.org/'
You can’t perform that action at this time.