Skip to content

Instantly share code, notes, and snippets.

@sirvine
sirvine / ember-data.js
Created April 10, 2012 14:28
Ember data for jsFiddle
(function() {
window.DS = Ember.Namespace.create({
CURRENT_API_REVISION: 4
});
})();
(function() {
@sirvine
sirvine / ember-0.9.6.js
Created April 10, 2012 14:36
Latest Ember.js
(function() {
/*global __fail__*/
/**
Define an assertion that will throw an exception if the condition is not
met. Ember build tools will remove any calls to ember_assert() when
doing a production build.
## Examples
#js:
@sirvine
sirvine / 2012-06-13-ember-data-latest.js
Created June 14, 2012 21:04
2012-06-13-ember-data-latest
(function(exports) {
window.DS = Ember.Namespace.create();
})({});
(function(exports) {
DS.Adapter = Ember.Object.extend({
commit: function(store, commitDetails) {
commitDetails.updated.eachType(function(type, array) {
@sirvine
sirvine / kalendae.js
Created June 18, 2012 15:13
Kalendae 0.2
/********************************************************************
* Kalendae, a framework agnostic javascript date picker *
* Copyright(c) 2012 Jarvis Badgley (chipersoft@gmail.com) *
* http://github.com/ChiperSoft/Kalendae *
* Version 0.2 *
********************************************************************/
(function (undefined) {
var today;
@sirvine
sirvine / kalendae.css
Created June 18, 2012 15:13
Kalendae 0.2
/** Base container **/
.kalendae {
display: inline-block;zoom:1;*display:inline;
background:#eee;
padding:10px;
margin:5px;
border-radius:5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
font-size:11px;
@sirvine
sirvine / gist:2974141
Created June 22, 2012 17:37
Ember.js Chosen Implementation
// This implementation assumes a router that calls connectOutlet on the current parent view's controller along the lines of:
// newThingController.connectOutlet({
// name: 'chosenSelect'
// })
//
//...which in turn assumes you've got App.ChosenSelectController with the sorting mixin along the lines of:
// App.ChosenSelectController = Ember.ArrayController.extend({
// content: App.store.findAll(App.Client),
// sortProperties: ['name'],
// sortAscending: true
@sirvine
sirvine / gist:3274222
Created August 6, 2012 12:50
Examples of Valid JSON – Single Record
{
"project":
{
"client_id":
29,
"created_at":
"2012-08-03T19:26:40Z",
"deal_team_memberships":
[
190,
@sirvine
sirvine / gist:3274233
Created August 6, 2012 12:50
Examples of Valid JSON – Multiple Records
{
"projects":
[
{
"client_id":
29,
"created_at":
"2012-08-03T02:38:18Z",
"deal_team_memberships":
[
@sirvine
sirvine / PFTwitterUtils+NativeTwitter.m
Created July 28, 2013 02:24
Reverse OAuth for Twitter API via Parse.com
+ (void)twitterReverseAuthResponseReceived:(NSData *)responseData
{
if (responseData) {
NSString *responseStr = [[NSString alloc]
initWithData:responseData
encoding:NSUTF8StringEncoding];
NSArray *parts = [responseStr componentsSeparatedByString:@"&"];
if (parts.count == 4) {
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost