This file contains hidden or 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
var o = {}; /* namespace */ | |
(function(undefined) { | |
this.trimPeriods = function(s) { | |
var return_string; /* private to trimPeriods() */ | |
(function killCrushDestroy(s) { /* a non-polluting-recursive-function (that trims periods from the end of a string) */ | |
if (s.substr(s.length - 1, 1) == ".") { | |
killCrushDestroy(s.substring(0, s.length - 1)); |
This file contains hidden or 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
$.ajax({ | |
url: "/some_path/foo.php", /* a url that returns a fragment of html */ | |
dataType: "html", /* ask for and expect html */ | |
success: function(html){ | |
var $fragment = $("<div/>") /* make a fragment (createDocumentFragment() won't work) */ | |
.html(html) /* put the html into the div so we can get at stuff in jQuery */ | |
.find("#some_id"); /* we can now .find() things! */ | |
/* if there's a <span id="some_id" data-foo="bar"></span> in out returned html, then... */ |
This file contains hidden or 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
AddType application/vnd.ms-fontobject .eot | |
AddType application/octet-stream .otf .ttf | |
AddType application/x-font-woff .woff |
This file contains hidden or 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
/* redefine the padding for iphone so a span 6 will fit in the viewport */ | |
@media only screen and (max-device-width: 480px), | |
only screen and (-webkit-min-device-pixel-ratio: 2) { | |
.container-fluid { | |
padding-right: 10px; | |
padding-left: 10px; | |
*zoom: 1; | |
} | |
} |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>CSS3 Pulse Ring</title> | |
<style> | |
.gps_ring { | |
border: 3px solid #999; | |
-webkit-border-radius: 32px; |
This file contains hidden or 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
// Distilled from http://stackoverflow.com/questions/6677035/jquery-scroll-to-element | |
$outer_container.animate({ | |
scrollTop: $("#inner_container").offset().top | |
}, 2000); |
This file contains hidden or 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
// Adapted from: https://gist.github.com/gnomeontherun/5678505 | |
(function(angular, document){ | |
'use strict'; | |
angular.module('YOURMODULENAMEHERE').factory('intercept', ['$q', function($q) { | |
console.log("intercept factory is running"); | |
var i = {}; | |
This file contains hidden or 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()%20{var%20root%20=%20$(document.getElementsByTagName(%27body%27));var%20watchers%20=%20[];var%20f%20=%20function(element)%20{if%20(element.data().hasOwnProperty(%27$scope%27))%20{angular.forEach(element.data().$scope.$$watchers,%20function(watcher)%20{watchers.push(watcher);});}angular.forEach(element.children(),%20function(childElement)%20{f($(childElement));});};f(root);console.log(watchers.length);}()); |
This file contains hidden or 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 lang="en" ng-app="butcher"> | |
<head> | |
<title>jimdotcom</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"> | |
<link rel="stylesheet" href="/css/nv.d3.min.css"> |
This file contains hidden or 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
@App.directive "onDelayedKeyup", ['$timeout', ($timeout) -> | |
(scope, element, attrs) -> | |
timer = false | |
element.bind "keyup", -> | |
$timeout.cancel(timer) if timer | |
timer = $timeout -> | |
scope.$apply attrs.onKeyup | |
, 500 | |
] |
OlderNewer