Skip to content

Instantly share code, notes, and snippets.

View jimjamdev's full-sized avatar
🎯
Focusing

Ian Jamieson jimjamdev

🎯
Focusing
View GitHub Profile
@samselikoff
samselikoff / MonthlyDatepickerComponent
Last active December 25, 2015 06:09
A monthly datepicker Ember component that wraps Bootstrap datepicker (https://github.com/eternicode/bootstrap-datepicker).
App.MonthlyDatepickerComponent = Ember.Component.extend({
classNames: ['dp'],
didInsertElement: function() {
var _this = this;
this.$().datepicker({format: 'M-yyyy',minViewMode: 'months'})
.on('changeDate', function(e) {
_this.sendAction('action', e.format());
});
@raytiley
raytiley / auth.js
Last active August 29, 2015 13:56
A controller using SimpleLogin from Firebase. Returns promises from login / logout to make working with Ember Routing simple.
var dbRef = new Firebase("https://YOUR-FIREBASE.firebaseio.com/");
export default Ember.Controller.extend({
/**
@property currentUser
@type {User}
@default null
*/
currentUser: null,
@mbbertino
mbbertino / gist:5ac801c22fa9f3748a49
Last active August 29, 2015 14:05
Ember CLI, EmberFire, Firebase Simple Login Email/Password Protected Routes
// Router
import Ember from 'ember';
var Router = Ember.Router.extend({
location: ClientENV.locationType
});
Router.map(function() {
this.resource('login');
this.resource('secretRouteToBeProtected');
/* Original source: https://gist.github.com/oskarrough/914653b03d886c015320
* Modified fork: https://gist.github.com/consideRatio/761c6286158e70feaed7
*
* Working authentication with
* Firebase 2.0.x + Ember.js 1.8.1 + Ember Data Canary + EmberFire 1.3.0 + Ember CLI
* works for me! oskar@rough.dk
*
* Note: this assumes you've set up login on your Firebase,
* only handles Google and Facebook for now.
*
@airtonix
airtonix / 0.README.md
Created January 18, 2015 23:46
Sails.Js with Passport.js and Passport-JWT

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
@aantipov
aantipov / sails_find_blueprint
Created February 24, 2015 19:57
Custom find blueprint for sails.js. Get total records count and sent it via X-Total-Count header
'use strict';
/**
* Module dependencies
*/
var actionUtil = require('sails/lib/hooks/blueprints/actionUtil'),
_ = sails.lodash;
var async = require('sails/node_modules/async');
/**
@MiguelLattuada
MiguelLattuada / .ts
Created December 26, 2015 22:22
Adding parameters to HTML get request on Anuglar 2
public getForecast(days: number) {
// Parameters obj-
let params: URLSearchParams = new URLSearchParams();
params.set('appid', StaticSettings.API_KEY);
params.set('cnt', days.toString());
//Http request-
return this.http.get(StaticSettings.BASE_URL, {
search: params
}).subscribe(