Skip to content

Instantly share code, notes, and snippets.

View LeonardoGentile's full-sized avatar

LeonardoGentile

  • Jellysmack
  • Nice, France
View GitHub Profile
@LeonardoGentile
LeonardoGentile / gulpfile.js
Created June 8, 2016 15:07 — forked from soin08/gulpfile.js
Gulpfile.js to use with Django projects. Based on gulpfile.js from Google Web Starter Kit.
//Based on gulpfile.js from Google Web Starter Kit.
//https://github.com/google/web-starter-kit
'use strict';
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var runSequence = require('run-sequence');
var browserSync = require('browser-sync');
@LeonardoGentile
LeonardoGentile / angularjs-providers-explained.md
Created March 18, 2016 12:17 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@LeonardoGentile
LeonardoGentile / flightplan-deploy.md
Last active September 11, 2015 13:28 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
/**********************************************
* Ink v1.0.5 - Copyright 2013 ZURB Inc *
**********************************************/
/* Client-specific Styles & Reset */
#outlook a {
padding: 0;
}
@LeonardoGentile
LeonardoGentile / material-design-colour-palette-variables.scss
Last active August 29, 2015 14:25
Material Design colour palette made into Sass variables.
// Material Design Colour Palette
// by Brandon Himpfen http://www.himpfen.com/
// Red
$md-red-50: #ffebee;
$md-red-100: #ffcdd2;
$md-red-200: #ef9a9a;
$md-red-300: #e57373;
$md-red-400: #ef5350;
$md-red-500: #f44336;
@LeonardoGentile
LeonardoGentile / D3MarginConvention.md
Last active September 7, 2015 15:14 — forked from mbostock/.block
D3 Margin Convention

First define the margin object with properties for the four sides (clockwise from the top, as in CSS).

var margin = {top: 20, right: 10, bottom: 20, left: 10};

Then define width and height as the inner dimensions of the chart area.

var width = 960 - margin.left - margin.right,
    height = 500 - margin.top - margin.bottom;

Lastly, define svg as a G element that translates the origin to the top-left corner of the chart area.

// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"

Intro

session-less use of jwt and passport.js

note: by module I mean either a javascript (.js) or coffeescript (.coffee) file

installation

install the following:

  • sailsjs

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@LeonardoGentile
LeonardoGentile / dabblet.css
Created September 2, 2014 15:52 — forked from telic/dabblet.css
Lined Paper
/**
* Lined Paper
*/
html {
background-color:white;
padding:10px;
font-family:sans-serif; font-size:15px;
}
body {