Skip to content

Instantly share code, notes, and snippets.

View JemiloII's full-sized avatar

Brian Jemilo II JemiloII

View GitHub Profile
@JemiloII
JemiloII / ticker.js
Last active August 29, 2015 14:02
Attempt to make mongo have mysql like id
module.exports = {
autoPK: false,
attributes: {
id: {
type: 'integer',
primaryKey: true,
autoIncrement: true
}
@JemiloII
JemiloII / gist:1cf15e3acd29eb2192a4
Created June 19, 2014 23:31
Showing objects to Cody
var objectName = {}; // This is just declaring a object if you nothing to put in it.
// some frameworks do stuff like this
objectName = {
name: "Brian",
dosomething: function(res){
console.log('something');
}
}
@JemiloII
JemiloII / app.js
Last active August 29, 2015 14:03
Sails Adaptor for Ember Data
App = Ember.Application.create();
//var posts = [{id: '1', title: "Rails is Omakase", author: { name: "d2h" }, date: new Date('12-27-2012'), excerpt: "There are lots of à la carte software environments in this world. Places where in order to eat, you must first carefully look over the menu of options to order exactly what you want.", body: "I want this for my ORM, I want that for my template language, and let's finish it off with this routing library. Of course, you're going to have to know what you want, and you'll rarely have your horizon expanded if you always order the same thing, but there it is. It's a very popular way of consuming software.\n\nRails is not that. Rails is omakase."}, { id: '2', title: "The Parley Letter", author: { name: "d2h" }, date: new Date('12-24-2012'), excerpt: "My [appearance on the Ruby Rogues podcast](http://rubyrogues.com/056-rr-david-heinemeier-hansson/) recently came up for discussion again on the private Parley mailing list.", body: "A long list of topics were raised
@JemiloII
JemiloII / file.js
Created July 7, 2014 18:17
This is what I was talking about. Same thing could go for the routes as well.
App.ModelIndexController = Ember.ObjectController.extend({
//stuff
});
App.ModelNewController = Ember.ObjectController.extend({
//stuff
});
App.ModelController = Ember.ObjectController.extend({
index: function(){
@JemiloII
JemiloII / ok.js
Last active August 29, 2015 14:03
Changing up my json to fit ember
/**
* 200 (OK) Response
*
* Usage:
* return res.ok();
* return res.ok(data);
* return res.ok(data, view);
* return res.ok(data, redirectTo);
* return res.ok(data, true);
*
@JemiloII
JemiloII / app.js
Last active August 29, 2015 14:04
Just wanting to retrieve data the Ember way~
window.App = Ember.Application.create({
LOG_TRANSITIONS: true
});
App.Router.map(function(){
this.resource('about');
this.resource('users');
});
App.Router.reopen({
@JemiloII
JemiloII / index.html
Created July 24, 2014 19:48
For locks~
<!DOCTYPE html>
<html>
<head>
<title>Testing Ember</title>
<style>.active{font-weight: bold; text-decoration: none;}</style>
</head>
<body>
<script type="text/x-handlebars">
<nav>
{{#link-to 'index'}}Home{{/link-to}} |
/* Put your CSS here */
html, body {
margin: 20px;
}
.active {font-weight: bold;}
@JemiloII
JemiloII / Member.js
Last active August 29, 2015 14:05
Showing Dafe_ my controller
App.Member = DS.Model.extend({
username: DS.attr('string'),
type: DS.attr('string'),
createdAt: DS.attr('date'),
updatedAt: DS.attr('date'),
});
@JemiloII
JemiloII / serializer.js
Created August 28, 2014 20:28
My serializer.js
App.ApplicationSerializer = DS.JSONSerializer.extend({
serializeIntoHash: function(hash, type, record, options) {
Ember.merge(hash, this.serialize(record, options));
}
});