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 / 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
@RichAyotte
RichAyotte / fiddle.response.html
Created January 11, 2014 15:55
Hello World! Fiddle response
<h1>Hello World!</h1>
@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 / 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 / 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 / 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 / self-cert.sh
Created May 9, 2017 22:31
Self signed cert on Linux for Chrome 58+
#!/bin/sh
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout server.pem \
-new \
-out server.pem \
-subj /CN=localhost \
@RichAyotte
RichAyotte / advise-find-dataloader.js
Created November 18, 2017 03:13
Sequelize Dataloader Advices
/**
* @overview Sequelize find - dataloader advice
* @author Richard Ayotte
* @copyright Copyright © 2017 Richard Ayotte
* @date 2017-11-03
* @license GNU GPL-3.0
* @flow
*/
'use strict'
@RichAyotte
RichAyotte / install-vuescan.sh
Last active January 26, 2022 09:27
Install VueScan on Debian
#!/bin/bash
#title :install-vuescan.sh
#description :This script will install VueScan onto a Debian system
#author :Richard Ayotte
#usage :install-vuescan.sh vuescan.tgz
#requirements :alien, the Industrial GTK theme and sudo access
#==============================================================================
if [ "$#" -ne 1 ]; then
echo "You must specify the VueScan tgz file."
@RichAyotte
RichAyotte / crypto.js
Created April 28, 2018 19:39
Crypto helper module
/**
* @overview Crypto helper
* @author Richard Ayotte
* @copyright Copyright © 2018 Richard Ayotte
* @date 2018-04-27 17:52:01
* @license GNU GPL-3.0
* @flow
*/
'use strict'