Skip to content

Instantly share code, notes, and snippets.

@gaboesquivel
gaboesquivel / gist:9433595
Last active Aug 29, 2015
ngbp with grunt-contrib-connect
View gist:9433595
# The actual `grunt serve` settings
connect:
options:
port: 9000
hostname: "localhost"
# livereload: 35729
dist:
options:
View Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {},
}
},
View style_guide.md

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

View style_guide.md

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

View api-provider.js
/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn (jelbourn@google.com)
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/
View http-response-interceptor.js
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
View gulpfile-express.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,
View gist:29250eb034487f9ff0e8
# t_array if fetched from and external api
t_array.in_groups_of(15, false) do |group|
group.each do |attributes|
T.find_or_create_by!(a_id: attributes[:a_id]) do |t|
t.name = attributes[:name]
t.other = attributes[:other]
end
@gaboesquivel
gaboesquivel / points
Last active Aug 29, 2015
game points
View points
{
user_id : 888,
fantasy_tennis_points: 9999,
user_tournaments_points:[
333: {
tournament_id: 333,
total_points: 3000,
name: 'French Open',
user_categories_points: [
{