Skip to content

Instantly share code, notes, and snippets.

View knownasilya's full-sized avatar
🌒
And, behold, I come quickly; and my reward is with me.. Rev 22:12

Ilya Radchenko knownasilya

🌒
And, behold, I come quickly; and my reward is with me.. Rev 22:12
View GitHub Profile
App.CustomSelectView = Ember.View.extend({
templateName: "customSelect",
tagName: "ul",
classNames: ["custom-select"],
title: "Custom Select",
options: null,
selectedVarName: "selectedBasemap",
selectedOptions: [],
click: function (event) {
var $this = $(event.target),
@knownasilya
knownasilya / loadlayers.js
Last active December 19, 2015 02:49
Layers model empty
initBaseOverlays: function () {
var settings = this.get("settings"),
layers = this.get("content"),
baseOverlays,
apiKey = settings.apiKey,
overlayKey,
overlay,
subtype,
result = {};
@knownasilya
knownasilya / ProvidersShowView.js
Created July 3, 2013 12:47
Providers Show View
App.ProvidersShowView = Ember.View.extend({
templateName: "providersShow",
elementId: "providers",
popupBinding: "controller.controllers.map.providerPopup",
init: function () {
this._super();
this.createElement();
},
/* Begin Providers Collection */
providersCollection: Ember.CollectionView.extend({
App.Router.map(function () {
this.route("index", { path: "/" });
this.resource("map", function () {
this.resource("location", { path: "/:latlng"}, function () {
this.route("summary");
this.route("providers");
});
});
});
@knownasilya
knownasilya / log
Created July 8, 2013 13:38
router logs
Rendering application with default view <(subclass of Ember.View):ember382> Object {fullName: "view:application"}
Rendering map with <App.MapView:ember393> Object {fullName: "view:map"}
Rendering location with <App.LocationView:ember402> Object {fullName: "view:location"}
Rendering location with <App.LocationView:ember406> Object {fullName: "view:location"}
generated -> controller:location.index Object {fullName: "controller:location.index"}
Could not find "location.index" template or view. Nothing will be rendered Object {fullName: "template:location.index"}
Transitioned into 'map.location.index'
Transitioned into 'map.location.index'
@knownasilya
knownasilya / new_gist_file
Created July 10, 2013 19:08
grunt-docco error
Running tasks: docco
Running "docco" task
[D] Task source: C:\Users\iradchenko\Desktop\The_Board\node_modules\grunt-docco\
tasks\docco.js
Running "docco:debug" (docco) task
[D] Task source: C:\Users\iradchenko\Desktop\The_Board\node_modules\grunt-docco\
tasks\docco.js
@knownasilya
knownasilya / rsvpAjax.js
Created July 11, 2013 13:42
RSVP with jQuery.ajax
return Ember.RSVP.Promise(function (resolve, reject) {
var hash = {
url: geocodeUrl + "/" + params.latlng,
dataType: "jsonp",
jsonp: "jsonp",
data: {
key: apiKey,
includeEntityTypes: "Address"
}
};
App.SurveysNewController = Ember.ObjectController.extend({
createSurvey: function (model) {
var record = App.Survey.createRecord(model);
record.one("didCreate", function () {
this.transitionToRoute("surveys");
});
record.get("transaction").commit();
}
});
  • node_modules/
  • app/
    • server.js
    • server/
  • models.js
@knownasilya
knownasilya / addresses.js
Created July 29, 2013 15:03
api addresses
app.get(relativeRoute('/api/addresses'), function (req, res) {
var island = req.param('island'),
result = {};
if (island) {
Address.find({ island: island, existing_address: { $nin: ['', ' '] } }, function (err, addresses) {
if (err) {
console.log(err);
res.send(404);
return;