Skip to content

Instantly share code, notes, and snippets.

View runspired's full-sized avatar
💜
Pondering Paradigms

Chris Thoburn runspired

💜
Pondering Paradigms
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
/*
This code is to fix Microsoft TextRange object (IE8 and below), to give equivalent of
HTML5 Range object's startContainer,startOffset,endContainer and endOffset properties.
*/
/**
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
/*
* Little example of how to use ```socket-io.client``` and ```request``` from node.js
* to authenticate thru http, and send the cookies during the socket.io handshake.
*/
var io = require('socket.io-client');
var request = require('request');
/*
* This is the jar (like a cookie container) we will use always
/**
* Module requirements.
*/
var XMLHttpRequest = require('xmlhttprequest');
var Polling = require('./polling');
var Emitter = require('component-emitter');
var inherit = require('component-inherit');
var debug = require('debug')('engine.io-client:polling-xhr');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Notifying a property change on a property passed into a child component',
description: 'There is a parent component with some buttons. When a user clicks on a button, the buttons\'s action changes the property. Since the changed property is passed into the wrapped component, you would expect that it\'s observer would fire also. But it does not. To try this, just type in 1233 and you will see that the last 3 will not render.'
});
@runspired
runspired / application.controller.js
Created November 4, 2015 01:50 — forked from Asherlc/application.controller.js
Association Computation
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
addWord: function() {
var word = this.store.createRecord('word', {
});
this.get('model.pages.firstObject.words')
import Ember from 'ember';
export default Ember.Route.extend({
init() {
this._super(...arguments);
$.mockjax({
url: '/users',
responseText: {
users: [{
@runspired
runspired / application.controller.js
Last active January 6, 2016 18:16 — forked from denzo/application.controller.js
Computed Properties with @each
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
owner: Ember.computed(function() {
return this.store.createRecord('owner');
}),
cleanItems: Ember.computed('owner.items.content.@each.status',function() {
@runspired
runspired / application.controller.js
Created January 11, 2016 11:22 — forked from miguelcobain/application.controller.js
didReceiveAttrs array changes
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
items: [
'Item 1',
'Item 2',
'Item 3',
'Item 4'
],
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
time: new Date(),
showYield: false,
actions: {
updateTime() {