Skip to content

Instantly share code, notes, and snippets.

MacOS

Download from here:

http://d.pr/f/QE3d

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to:

<!-- MODAL -->
<div class="modal fade" id="ordersDetailList" tabindex="-1" ng-model="selectedDetails"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<table class="table">
<thead>
<th ng-repeat="(key,value) in selectedDetails">{{key}}</th>
@bkbartonDesign
bkbartonDesign / working with object
Last active December 21, 2015 09:39
Working with objects
obj = { a:1, b:2 };
//loop through and get key/val
for ( var key in obj ){
var objkey = key;
var objval = obj[key];
}
@bkbartonDesign
bkbartonDesign / Iterate over object array in ng
Created August 14, 2013 21:52
Iterate over an array of objects in angular
<table class="table">
// Return the keys on the first returned object **setup table header**
<tr><th ng-repeat="(key,value) in objects[0]">{{key}}</th></tr>
// Return the values of each object value in aray
<tr ng-repeat="object in objects">
<td ng-repeat="(key2, value) in object">{{value}}</td>
</tr>
</table>
@bkbartonDesign
bkbartonDesign / gist:5888875
Created June 28, 2013 23:15
LESS example: making background-image vender agnostic.
.background-image(@imageURL){
background: url(@imageURL) no-repeat 0 0;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@bkbartonDesign
bkbartonDesign / gist:5888628
Created June 28, 2013 22:23
URL for retrieving an instagram access_token
https://instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token
@bkbartonDesign
bkbartonDesign / Responsive Helper
Created June 18, 2013 21:34
Console based responsive helper
// Responsive Helper //
// Consoles to width of the screen and tells roughly what device would be viewing it.
$width = $(document).width();
if ($width>1024)
console.log("large screen. range:x<>1024. width = "+$width);
else if ($width>960)
console.log("standard screen. range:1024<>960. width = "+$width)
else if ($width>768)
console.log("tablet portrait to standard 960. range:960<>768. width = "+$width)
@bkbartonDesign
bkbartonDesign / gist:5800396
Created June 17, 2013 21:01
jQuery - scroll event with conditional looking for the bottom of the document.
// Test whether page has touched already scolled to btm.
var bottomFlag = false
$(window).scroll(function(e) {
// Check if we reached bottom of the document and fadeOut the target element
if ( bottomFlag === false && $(window).scrollTop() + $(window).height() == $(document).height() ) {
// DO SOMETHING HERE...
bottomFlag = true;
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, fn) {
var buffer = "",
key;