Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| - index.js | |
| - package.json | |
| - public/js/main.js | |
| - public/index.html | |
| - css/bootstrap-responsive.min.css | |
| - css/flatly-bootstrap.min.css |
| angular.module('myApp').directive('addthisToolbox', ['$timeout', function($timeout) { | |
| return { | |
| restrict : 'A', | |
| transclude : true, | |
| replace : true, | |
| template : '<div ng-transclude></div>', | |
| link : function($scope, element, attrs) { | |
| $timeout(function () { | |
| addthis.init(); | |
| addthis.toolbox($(element).get(), {}, { |
| controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) { | |
| $scope.$on('authLoaded', function() { | |
| $scope.isExpert($scope.main.serieId); | |
| $scope.isMember($scope.main.serieId); | |
| }); | |
| $scope.loadAuth = function() { | |
| Auth.load().success(function(data) { | |
| $scope.main.user = data.user; | |
| $scope.$broadcast("authLoaded"); |
| playVideo: function() { | |
| this.hidePoster(); | |
| if (!YT) { | |
| $('head').append('<script src="//www.youtube.com/iframe_api" type="text/javascript"></script>'); | |
| } | |
| if (this.player) { | |
| this.player.loadVideoById(this.videoId); | |
| this.player.playVideo(); | |
| } else { |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.
Usage:
git-status [directory]This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.
| <?php | |
| // Custom field for the images | |
| $images = get_field('gallery_images'); | |
| /** | |
| * The data returned from the $images variable is an array with the following items | |
| * | |
| * Array ( | |
| * [id] => 540 | |
| * [alt] => A Movie |
(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)|(?<DatelessNorthernIreland>^[A-Z]{1,3}[0-9]{1,4}$)|(?<DiplomaticPlate>^[0-9]{3}[DX]{1}[0-9]{3}$)
For use in JavaScript (with named groups removed):
(^[A-Z]{2}[0-9]{2}\s?[A-Z]{3}$)|(^[A-Z][0-9]{1,3}[A-Z]{3}$)|(^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(^[0-9]{1,4}[A-Z]{1,2}$)|(^[0-9]{1,3}[A-Z]{1,3}$)|(^[A-Z]{1,2}[0-9]{1,4}$)|(^[A-Z]{1,3}[0-9]{1,3}$)|(^[A-Z]{1,3}[0-9]{1,4}$)|(^[0-9]{3}[DX]{1}[0-9]{3}$)
| var waitForGlobal = function(key, callback) { | |
| if (window[key]) { | |
| callback(); | |
| } else { | |
| setTimeout(function() { | |
| waitForGlobal(key, callback); | |
| }, 100); | |
| } | |
| }; | |