This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// cpuse.js - simple continuous cpu monitor for node | |
// | |
// Intended for programs wanting to monitor and take action on overall CPU load. | |
// | |
// The monitor starts as soon as you require the module, then you can query it at | |
// any later time for the average cpu: | |
// | |
// > var cpuse = require('cpuse'); | |
// > cpuse.averages(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app="sampleKinveyApp"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bootstrap, from Twitter</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Le styles --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"_id": "theArtist", | |
"title": "The Artist", | |
"year": 2011, | |
"director": "Michel Hazanavicius", | |
"awards": [{"event": "Academy Awards", | |
"awards": [{"name": "Best Picture", "notes": ""}, | |
{"name": "Best Director", "notes": "Hazanavicius"}, | |
{"name": "Best Actor", "notes": "Dujardin"}, | |
{"name": "Best Costume Design", "notes": ""}, | |
{"name": "Best Original Score", "notes": ""}]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find all Dr's named Joe at Mercy Hospital | |
GET /appdata/[appKey]/doctors/?query={"firstName": "Joe", "hospital": "Mercy"} | |
[{"_id": "998798ad987fe987e987bc98766", | |
"firstName": "Joe", | |
"lastName": "Brown", | |
"hospital": "Mercy", | |
"speciality": "oncology"}, | |
{"_id": "ca6775feba86554", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /appdata/[appKey]/stories/?query={"name":"Dewey Defeats Truman"} | |
[{"_id": "deweyDefeatsTruman", | |
"name": "Dewey Defeats Truman", | |
"reporter": "Arthur Sears Henning"}] | |
GET /appdata/[appKey]/comments/?query={"storyId":"deweyDefeatsTruman"} | |
[{"_id": "001", | |
"storyId": "deweyDefeatsTruman", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
new_window = window.open(); | |
new_window.document.body.innerHTML = $("iframe") | |
.contents() | |
.find("iframe") | |
.contents() | |
.find("body") | |
.get(1).innerHTML; | |
new_window.document.body.querySelector("#content-overlays").remove(); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
function singleton( c:Class ):* | |
{ | |
return c in instances ? instances[c] : instances[c] = new c(); | |
} | |
} | |
import flash.utils.Dictionary; | |
var instances:Dictionary = new Dictionary( false ); |