Skip to content

Instantly share code, notes, and snippets.

View RichAyotte's full-sized avatar
🌮
tezos tacos

Richard Ayotte RichAyotte

🌮
tezos tacos
View GitHub Profile
@RichAyotte
RichAyotte / randemail.sh
Last active February 5, 2017 15:31
Random email address
echo `< /dev/urandom tr -dc [:alnum:] | head -c20`'@'`< /dev/urandom tr -dc [:alnum:] | head -c20`'.com'
@RichAyotte
RichAyotte / demo.html
Last active January 10, 2019 22:52
Performance Comparison for React, Angular and Knockout
<!DOCTYPE html>
<html ng-app="test">
<head>
<title>Performance Comparison for Knockout, Angular and React</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.css" rel="stylesheet" />
<style type="text/css">
* { box-sizing:border-box; }
body { padding:30px 0; }
h2 { margin:0; margin-bottom:25px; }
h3 { margin:0; padding:0; margin-bottom:12px; }
@RichAyotte
RichAyotte / create-tables.js
Created April 11, 2014 17:35
Initial Sequelize Migration with existing database.
// Inspired by http://bulkan-evcimen.com/using_sequelize_migrations_with_an_existing_database
var Promise = require('bluebird');
var fs = Promise.promisifyAll(require('fs'));
module.exports = {
up: function(migration, DataTypes, done) {
var db = migration.migrator.sequelize;
fs.readFileAsync(__dirname + '/initial.sql', {encoding: 'utf8'})
.then(function(initialSchema) {
var tables = initialSchema.split(';');
@RichAyotte
RichAyotte / ruby-iterator.sjs
Created February 6, 2014 23:30
Ruby array iterator in JavaScript using Sweet.js
// Ever wish you could iterate JavaScript arrays like you do in Ruby?
// Well you can with this sweet.js macro.
macro do {
rule infix { $lh.each | _ $rh _ $body ... end} => {
$lh.forEach(function($rh){
$($body) ...
});
}
}
@RichAyotte
RichAyotte / fiddle.response.html
Created January 11, 2014 15:55
Hello World! Fiddle response
<h1>Hello World!</h1>
@RichAyotte
RichAyotte / fiddle.response.json
Created March 23, 2012 00:44
fiddle.response.json
{"identifier":"id","label":"name","items":[{"id":223,"name":" 1527, 19th st NW, Calgary, Alberta"},{"id":188,"name":"#204 - 720 Willowbrook Rd. NW, Airdrie, Alberta"},{"id":345,"name":"#700, 540 - 5th Avenue SW, Calgary, Alberta"},{"id":368,"name":"1 Concorde Gate, Toronto, Ontario"},{"id":59,"name":"1 McDonald's Place, Toronto, Ontario"},{"id":95,"name":"1 Queen St. E, Toronto, Ontario"},{"id":48,"name":"1 Steelcase Road West, Markham, Ontario"},{"id":305,"name":"1 University Ave., Toronto, Ontario"},{"id":178,"name":"10 Park Lawn Rd., Toronto, Ontario"},{"id":293,"name":"10 Perdue Court, Caledon, Ontario"},{"id":374,"name":"100 Commerce Valley Dr E, Markham, Ontario"},{"id":180,"name":"100 Unwin Ave., Toronto, Ontario"},{"id":141,"name":"100, 229 - 33rd Street N.E., Calgary, Alberta"},{"id":94,"name":"101 Town Centre Blvd., Markham , Ontario"},{"id":148,"name":"10101 Southport Road SW, Calgary, Alberta"},{"id":67,"name":"1016A Sutton Dr., Burlington , Ontario"},{"id":207,"name":"102 Ruscica Dr. , Toronto, O