Skip to content

Instantly share code, notes, and snippets.

@code0100fun
code0100fun / app_controllers_sign-in.js
Created June 8, 2015 20:02
Ember Simple AUth + Ember CLI Mirage
// app/controllers/sign-in.js
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
signIn(){
this.set('errors', null);
var params = { identification: this.get('email'), password: this.get('password') };
// Redirects to index route on success (configurable in config/environment.js)
this.get('session').authenticate('simple-auth-authenticator:oauth2-password-grant', params);
@RyannosaurusRex
RyannosaurusRex / Ember in ASP.NET MVC.md
Last active July 8, 2024 04:38
Adding an EmberJS app to an ASP.NET MVC app

How to set up an Ember app inside of an ASP.NET MVC app.

I love Ember. It helps me build fantastic UIs, but security isn't super straightforward and I suck at it. I love ASP.NET MVC. It help me build secure applications and solid APIs, but for some apps I need a great responsive UI with great interaction.

Together, these two technologies can be used together to create really amazing apps (and really quickly, too). So this guide is to show you how to set them up together.

Note: This article assumes you have created a stock new ASP.NET project within Visual Studio and included MVC and WebAPI options. It also assumes you have EMBER CLI installed and have run ember new my-ember-app into a directory in the root of your ASP.NET MVC project.

@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active May 7, 2024 13:07
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
var agg = [
{$group: {
_id: "$episodeId",
// FAIL!!!! :(
total: {$count: "episodeId"}
}}
];
Tracking.aggregate(agg, function(err, logs){
@wycats
wycats / connection-problems.md
Created October 22, 2013 14:07
Connection Issues

Let's say we have a stream that represents the value of a property on some object.

var stream = new PathStream(post, 'title');

When we subscribe to this stream, we want to get its current value right away, and then any subsequent changes to the value.

In order to do this, we implement PathStream to hold onto a reference to the current value, and implement its subscribe to always emit the current value right away.

<HTabControl Grid.Row="1" ItemsSource="{Binding Path=OutNursingPartStatementFolderList}" SelectedItem="{Binding Path=SelectedNursingPartFolder}"
SelectedValuePath="NRST_FLDR_CTG_CD" DisplayMemberPath="FLDR_NM" ItemContainerStyle="{StaticResource treeItemStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding Path=SelectionFolderChangedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</HTabControl>
@haacked
haacked / csharp-conventions.md
Last active December 23, 2015 07:29
Examples of C# code conventions for http://sideeffect.kr/popularconvention/

Space vs Tab

Space

public string GetSomething()
{
    return something;
}
@tomdale
tomdale / gist:6382021
Created August 29, 2013 18:56
Ember inspector description
The Ember Inspector is a plug-in for the Chrome developer tools that makes understanding and debugging your Ember.js application a snap.
After installing this extension, you'll be able to easily:
- View all of the routes defined in your application.
- Reference Ember's naming conventions for your URLs, including what to name your controllers, templates, routes and more.
- Overlay your application with information about what templates, controllers, and models are currently being rendered.
- Inspect the objects in your application, such as models and controllers, with UI that fully supports Ember features such as bindings and computed properties.
- Make your application's objects available in the console as the $E variable.
@seifsallam
seifsallam / RESTAdapter.js
Last active August 15, 2016 19:37
Ember RESTAdapter configuration for sending HTTP header and CrossDomain Access
// store.js
App.Adapter = DS.RESTAdapter.reopen({
bulkCommit: false,
url: 'http://localhost:5000',
namespace: 'api',
corsWithCredentials: true,
headers: {
'Accept': 'application/vnd.vendor+json;version=1',
'Content-type': 'application/json',