Skip to content

Instantly share code, notes, and snippets.

View iddar's full-sized avatar
🤹‍♂️
code juggling

Iddar Olivares iddar

🤹‍♂️
code juggling
View GitHub Profile
require "try-catch"
try {
function()
error('oops')
end,
catch {
function(error)
print('caught error: ' .. error)
@iddar
iddar / index.js
Created July 16, 2015 01:21
requirebin sketch
var React = require( 'react')
var Reflux =require('reflux')
var TimeActions = Reflux.createActions(['tick'])
var TimeStore = Reflux.createStore({
listenables: [TimeActions],
onTick: function(tick) {
this.trigger(tick);
@iddar
iddar / readme.md
Last active September 11, 2015 06:51 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@iddar
iddar / performance.now()-polyfill.js
Last active September 12, 2015 03:01 — forked from paulirish/performance.now()-polyfill.js
performance.now() polyfill (aka perf.now())
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
// github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
@iddar
iddar / index.js
Created October 11, 2015 18:13
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var axios = require('axios')
axios.get('http://api-m2x.att.com/v2/devices/f816f8513a16d9bd7e38ae2ec87e6e77/streams/edison/values')
.then(function (response) {
console.log(response);
})
.catch(function (response) {
console.log(response);
@iddar
iddar / Pacman loading animation in one div.markdown
Created October 16, 2015 07:56
Pacman loading animation in one div
@iddar
iddar / npm-upgrade-bleeding.sh
Created October 26, 2015 18:34 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@iddar
iddar / nextTick.js
Created November 17, 2015 18:09 — forked from mmalecki/nextTick.js
process.nextTick vs setTimeout(fn, 0)
for (var i = 0; i < 1024 * 1024; i++) {
process.nextTick(function () { Math.sqrt(i) } )
}
@iddar
iddar / .bashrc
Created November 18, 2015 15:15 — forked from vsouza/.bashrc
Golang 1.4.1 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@iddar
iddar / README.md
Created November 19, 2015 18:16 — forked from balupton/README.md
Node.js Best Practice Exception Handling