Skip to content

Instantly share code, notes, and snippets.

var service = angular.module('statusboard.services', ['ngResource']);
service.factory('StatusboardService', ['$rootScope', '$resource', '$http',
function($rootScope, $resource, $http) {
// $resource endpoints
...
// application logic
(function refreshStatus() {
statusSvc.latest(function(response) {
@jrowny
jrowny / GalaxyS4.js
Created October 14, 2013 21:27
Galaxy S4 ripple definition
module.exports = {
"id" : "GalaxyS4",
"name": "Galaxy S4",
"manufacturer": "Samsung",
"model": "Samsung Galaxy S4",
"osName": "Android",
"uuid" : "872d2700-34f6-11e3-98fd-ce3f5508acd9",
"osVersion": "4.2.x",
@jrowny
jrowny / stuff.html
Last active December 20, 2015 20:09
Angular fade-in trick
<div class="fade" ng-class="{in:someData.length}">
I'm not visible until someData is there!
</div>
@jrowny
jrowny / quick-cors.js
Created August 8, 2013 16:41
A quick "serve this folder" express web server that has CORS way open. TEST ONLY don't you dare use this in production.
var express = require('express'),
app = express();
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With, origin, x-csrftoken, content-type, accept");
res.header("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE, OPTIONS");
next();
@jrowny
jrowny / README.md
Last active December 17, 2015 01:39 — forked from jasonsanjose/README.md

Choose a directory to download both brackets-shell and brackets git respositories. The following script will setup the repositories and download required dependencies.

wget -O - https://gist.github.com/jasonsanjose/5514813/raw/ff2c9f443e7c5a283df1b0a1f6bafd6f09f47e06/setup.sh | bash
@jrowny
jrowny / popoup.js
Last active December 10, 2015 14:18 — forked from augustl/popoup.js
$scope.addTab = function () {
var popupTemplateUrl = "/angular/templates/new-tab.html";
var popupTemplate = angular.element('<div ng-include="\'' + popupTemplateUrl + '\'></div>');
var popupElement = $compile(popupTemplate)($scope);
console.log(popupElement.get(0));
};
@jrowny
jrowny / index.html
Created June 27, 2012 23:51
posted from brackets
<!-- JS for CodeMirror search support, currently for debugging only -->
<script src="thirdparty/CodeMirror2/lib/util/dialog.js"></script>
<script src="thirdparty/CodeMirror2/lib/util/searchcursor.js"></script>
<script src="thirdparty/CodeMirror2/lib/util/search.js"></script>
@jrowny
jrowny / github.css
Created June 20, 2012 16:04
posted from brackets
#github .gh-logged-in {padding-left: 30px;
background-repeat: no-repeat;
background-position: 6px 7px;
background-size: 20px;}