Skip to content

Instantly share code, notes, and snippets.

@ajoslin
ajoslin / cart.json
Created November 9, 2017 23:00
cart
"{
\"tenantId\": \"StaplesDotCom\",
\"ctxId\": \"e70a241c0dff5dbacb0bbe7475218468.807d06bbe00e0c367e1aea9c9dbe9f80\",
\"type\": \"REGULAR\",
\"status\": \"ACTIVE\",
\"cartId\": \"131ffff4-c5a1-11e7-aff9-005056b473cb\",
\"items\": [
{
\"cartItemId\": \"131ffff5-c5a1-11e7-aff9-005056b473cb\",
\"itemId\": \"125328\",
@ajoslin
ajoslin / index.js
Created August 23, 2016 04:36
requirebin sketch
var yo = require('yo-yo')
var numbers = [] // start empty
var el = list(numbers, update)
function list (items, onclick) {
return yo`<div>
Random Numbers
<ul>
${items.map(function (item) {
@ajoslin
ajoslin / index.js
Created July 8, 2016 03:20
requirebin sketch
var Obstruct = require('obstruction')
var parse = Obstruct({
value: Obstruct.parent({
name: true
})
})
var result = parse({
value: {
@ajoslin
ajoslin / index.js
Created May 2, 2016 17:51
requirebin sketch
var assert = require('assert')
var prefix = require('inline-style-prefix-all')
var style = {
transitionProperty: 'transform'
}
document.body.innerHTML = [
'<div>first = ' + JSON.stringify(prefix(style,null,2)) + '</div>',
'<br/>',
@ajoslin
ajoslin / index.js
Created April 23, 2016 16:35
requirebin sketch
var murmur = require('murmurhash')
var cases = [
{ color: '#0008d0' },
{ color: '#000f82' }
]
document.body.innerHTML = cases
.map(JSON.stringify.bind(JSON))
.map(murmur)
@ajoslin
ajoslin / gist:3181630
Created July 26, 2012 11:52
bootstrap tabs in plain angular
<!-- Tab links at top, always visible with one 'active' -->
<ul class="nav nav-tabs">
<li ng-repeat="tab in tabs" ng-class="{active: selectedTab == tab}" ng-click="selectedTab = tab">
<a ng-href="#{{tab.id}}">{{tab.title}}</a>
</li>
</ul>
<!-- Tab contents, only one ever visible -->
<div class="tab-content">
<div ng-repeat="tab in tabs" class="tab-pane" ng-class="selectedTab == tab && 'active' || 'hide'" id="{{tab.id}}">
info: Welcome to Nodejitsu appriculture
info: jitsu v0.12.15, node v0.8.25
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node server.js
debug: { method: 'GET',
debug: uri: 'https://api.nodejitsu.com/apps/appriculture/appriculture-server',
debug: headers:
debug: { Authorization: '*************************************************************************',
debug: 'Content-Type': 'application/json' },
@ajoslin
ajoslin / errorlog
Created August 2, 2013 05:00
jitsu err
Error: Cannot find module 'firebase'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/opt/haibu/apps/appriculture/appriculture-server/package/lib/apprifire/index.js:2:16)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
@ajoslin
ajoslin / problems.md
Last active December 16, 2015 18:29
ui-bootstrap $dialog service refactor discussion

(written by @pawel)

We've got a number of bug reports opened for the $dialog service and while some of them can be fixed by (relatively) simple changes to the existing code-base some other are difficult to solve due to the way current code is structured. Additionally the existing API would benefit from some some simplifications.

This docs aims to list existing issues and propose a new API plus some implementations details that would address existing issues.

As a remainder, docs for the current service are located here: https://github.com/angular-ui/bootstrap/blob/master/src/dialog/README.md

Known issues

API

// The `$dialogProvider` can be used to configure global defaults for your
// `$dialog` service.
var dialogModule = angular.module('ui.bootstrap.dialog', ['ui.bootstrap.transition']);
dialogModule.controller('MessageBoxController', ['$scope', 'dialog', 'model', function($scope, dialog, model){
$scope.title = model.title;
$scope.message = model.message;
$scope.buttons = model.buttons;
$scope.close = function(res){
dialog.close(res);