Skip to content

Instantly share code, notes, and snippets.

View rachaelshaw's full-sized avatar
🕷️
"The spider didn't answer. She was very busy spinning her web."

Rachael Shaw rachaelshaw

🕷️
"The spider didn't answer. She was very busy spinning her web."
View GitHub Profile
@rachaelshaw
rachaelshaw / install-v0.10.sh
Created February 2, 2014 05:11
how to install the v0.10 version of sails
#
# Installing the v0.10 "edge" version of Sails
#
$ sudo npm install -g sails@git://github.com/balderdashy/sails.git#v0.10
@rachaelshaw
rachaelshaw / sails-generator-setup.md
Last active August 29, 2015 14:06
How to set up a Sails generator

#How to set up a Sails Generator

cd into the directory where you keep this kind of thing, and do:

sails generate generator GENERATOR-NAME

cd GENERATOR-NAME
@rachaelshaw
rachaelshaw / angular-rainbow.md
Last active April 26, 2016 06:31
Using Rainbow syntax highlighter with AngularJS
@rachaelshaw
rachaelshaw / gravatar-directive.js
Created December 4, 2014 19:51
Gravatar Angular Directive
/**
* gravatar
* ------------------------------------------------------------------------
* This is a custom directive for using gravatars.
*
* Usage:
* ```
* <gravatar email="gravataremail@example.com"
* default-img="http://placecage.com/c/200/200"></gravatar>
* ```
angular.module('TreelineExample').controller('AppCtrl', [
'$scope', '$timeout', '$http',
function ($scope, $timeout, $http){
console.log('running!');
$scope.homepage = {};
$scope.homepage.messageSent = false;
$scope.sendmessage = function() {

Step 1: Paste this in the <head> of layout.ejs:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>

Step 2:

<div ng-app="Pokemon" ng-controller="PokeCtrl">
@rachaelshaw
rachaelshaw / node-machine-2nd-example.md
Last active December 23, 2016 20:37
The 2nd example machine from the node-machine.org docs.

Here's the complete code for the "Get Klout Score" machine from the node-machine.org documentation:

module.exports = {
  friendlyName: 'Get Klout score',
  description: 'Get the Klout score for a Klout user.',
  extendedDescription: '',
  inputs: {
    kloutId: {
      example: '32423423432342',
@rachaelshaw
rachaelshaw / node-machine-1st-example.md
Last active December 23, 2016 20:26
The 1st example machine from the node-machine.org docs.

Here's the complete code for the "Get Klout ID" machine from the node-machine.org documentation:

module.exports = {
  friendlyName: 'Get Klout ID',
  description: 'Get the Klout ID from a Twitter screen name.',
  extendedDescription: '',
  inputs: {
    twitterScreenName: {
      example: 'tuneyards',
@rachaelshaw
rachaelshaw / example-model-definition.md
Created February 16, 2017 18:36
An example model definition for the Sails framework documentation - http://sailsjs.com/documentation
/**
* Parrot.js
* 
* @description :: The set of parrots registered in our app.
* @docs        :: http://sailsjs.com/documentation/concepts/models-and-orm/models
*/

module.exports = {
@rachaelshaw
rachaelshaw / advanced-queries-and-populate.md
Last active December 13, 2017 22:58
26. Queries avanzadas y .populate

Add to views/pages/things/available-things.ejs:

Replace the insides of the top-level <div> with:

<div class="container">
  <div class="page-header text-center">
    <h1>Things</h1>
    <h2>View available items to borrow, or upload your own things.</h2>
    <div class="header-buttons">
      <button class="btn btn-outline-primary">Add an item</button>
    </div>