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 / example-deployment-instructions.md
Created December 15, 2017 20:19
Example App - Migrations

Example devops instructions

Deployment

To deploy to staging:

sails run deploy
@rachaelshaw
rachaelshaw / file-uploads-frontend.md
Created December 14, 2017 17:21
32. Subiendo archivos frontend

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

Replace <div class="photo-upload-field"...> and everything inside with:

<div class="photo-upload-field row d-flex align-items-center" :class="!uploadFormData.previewImageSrc ? 'justify-content-center' :  'justify-content-start'" >
  <div class="photo-preview col">
    <div class="image-wrapper" :class="!uploadFormData.previewImageSrc ? 'd-flex align-items-center justify-content-center' : ''">
      <img v-if="uploadFormData.previewImageSrc" alt="A preview of the selected item" :src="uploadFormData.previewImageSrc"/>
      <span v-else class="placeholder-icon fa fa-picture-o"></span>
    </div>
  </div>
@rachaelshaw
rachaelshaw / putting-it-all-together.md
Last active December 14, 2017 15:40
30. Putting it all together

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

Add click event to header button:

<button class="btn btn-outline-primary" @click="clickAddButton()">Add an item</button>

Add modal:

<% /* "Upload thing" modal */ %>
<modal v-if="uploadThingModalOpen" v-cloak key="new" @close="closeUploadThingModal()">
  <div class="modal-header">
@rachaelshaw
rachaelshaw / modals.md
Last active December 13, 2017 22:53
27. Modales

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

<% /* "Delete thing" modal */ %>
<modal v-if="confirmDeleteThingModalOpen && selectedThing" v-cloak key="delete" @close="closeDeleteThingModal()">
  <div class="modal-header">
    <h5 class="modal-title">Remove this item?</h5>
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
      <span>&times;</span>
    </button>
  </div>
@rachaelshaw
rachaelshaw / available-things.less
Last active December 13, 2017 22:20
Ration example app final styles
// Replaces assets/styles/pages/things/available-things.less
#available-things {
.page-header {
text-align: center;
padding-top: 25px;
padding-bottom: 35px;
h1 {
.container-sm();
font-size: 22px;
font-weight: 900;
@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>
@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 / 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 / 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',

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">