Skip to content

Instantly share code, notes, and snippets.

View Sharondio's full-sized avatar
🏃‍♀️
Out-running deadlines

Sharon DiOrio Sharondio

🏃‍♀️
Out-running deadlines
View GitHub Profile
@Sharondio
Sharondio / drinks.json
Created December 12, 2012 21:48
Sample JSON data for demo apps. Copyright to Drinknation. For demo use only!
[{"image":"sexonthebeach.jpg","ingredients":[{"amount":"2/3 oz.","ingredient":"Peach schnapps"},{"amount":"1 1/3 oz.","ingredient":"Vodka"},{"amount":"1 1/3 oz.","ingredient":"Cranberry juice"},{"amount":"1 1/3 oz.","ingredient":"Orange juice"}],"instructions":"Combine ingredients in a cocktail shaker with ice. Shake and strain into a highball glass filled with ice.","name":"Sex on the Beach","id":"e9ac9d445adc98c9"},{"image":"kamikaze.jpg","ingredients":[{"amount":"1 oz.","ingredient":"Triple Sec or Cointreau"},{"amount":"1 oz.","ingredient":"Vodka"},{"amount":"1 oz.","ingredient":"Lime juice"},{"amount":"1","ingredient":"Lime wedge"}],"instructions":"Shake ingredients in a cocktail shaker with ice. Strain into a cocktail glass. Garnish with a lime wedge and a stir stick.","name":"Kamikaze","id":"3495e74cf9208855"},{"image":"jagerbomb.jpg","ingredients":[{"amount":"1 shot","ingredient":"Jagermeister"},{"amount":"4 oz.","ingredient":"Red Bull"}],"instructions":"Pour Red Bull into a regular glass, then drop in
@Sharondio
Sharondio / gist:5061810
Created March 1, 2013 01:39
Sample AngularJS service using $http
/* Services */
var services = angular.module('app.services', [])
services.factory( 'Drink', function($http) {
// Drink is a class which we can use for retrieving and
// updating data on the server
var Drink = function(data) { angular.extend(this, data); };
// a static method to retrieve Drink by ID
Drink.get = function(drink) {
@Sharondio
Sharondio / gist:5061834
Last active December 14, 2015 08:59
AngularJS $rootScope.$apply() attempt (not working, don't copy!)
'use strict';
module.exports = function (module) {
module.factory('PageEventsService', ['$rootScope', function ($rootScope) {
return {
// can't get it to receive :-(
on: function(event, callback) {
/**
* Paginator
*
* The paginator can be used within any controller to easily set up
* some pagination options, including number of pages, page navigation
* and more. It is built to work with Laravel's own pagination library,
* which returns data in a particular format.
*
* Usage:
* Before you can use paginator, make sure you specify the URLs to your pagination
@Sharondio
Sharondio / .jshintrc
Created November 7, 2013 02:06
My somewhat lax jshint prefs
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : true,
@Sharondio
Sharondio / gist:7809034
Last active December 30, 2015 09:28
Example of a simple service mock.
// MOCK SERVICES
beforeEach(mock.module('app-name', function ($provide) {
getContentData = require('../data/getContentData.json');
getVersionsData = require('../data/getVersionsData.json');
newPost = require('../data/newPost.json');
fullPost = require('../data/fullPost.json');
$provide.value('ContentSvc', {
find: function(filter, options, cb) {
@Sharondio
Sharondio / gist:8105460
Created December 23, 2013 21:52
Jade in a gruntfile, taking from my views directory and creating along with all sub-folders in my static directory.
jade: {
dynamic_mappings: {
files: [
{
expand: true,
cwd: 'views/',
src: ['**/*.jade'],
dest: 'static',
ext: '.html'
}
@Sharondio
Sharondio / gist:8563315
Created January 22, 2014 17:38
A simple string filter to format zeros and nulls to dash.
angular.module('my-app', [])
.filter('dash', function() {
return function(input) {
return input ? input : '-';
};
});
@Sharondio
Sharondio / bootstrap
Created January 27, 2014 19:58
Bootstrapping an angular app
// ************ Bootstrap App ****************
angular.element(document).ready(function () {
angular.bootstrap(document.getElementById('main_container'), ['my-app'])
})
// *******************************************
@Sharondio
Sharondio / elizabot
Created May 14, 2014 23:07
From my IRC bot demo during cfobjective
fusiongrokker: please tell me sharon is pulling up irc on stage…
[4:40pm] RyanGuill: that would be awesome
[4:40pm] elizabot joined the chat room.
[4:40pm] fusiongrokker: YAY
[4:40pm] fusiongrokker: hi mom
[4:41pm] abram: hey Sharon
[4:41pm] fusiongrokker: I CAN SEE MY HOUSE FROM HERE
[4:41pm] bittersweetryan joined the chat room.
[4:41pm] sharondio: elizabot: Hello
[4:41pm] elizabot: sharondio: How do you do. Please tell me your problem.