Skip to content

Instantly share code, notes, and snippets.

View yuetyeelo2855's full-sized avatar

Sherry Lo yuetyeelo2855

View GitHub Profile
@yuetyeelo2855
yuetyeelo2855 / docker-compose.yml
Created December 17, 2016 02:55
Example docker-compose.yml of Nginx Proxy with Let's Encrypt
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
privileged: true
ports:
- 80:80
- 443:443
volumes:
- ./nginx-proxy/certs:/etc/nginx/certs:ro
- ./nginx-proxy/htpasswd:/etc/nginx/htpasswd
(function () {
var dateTimeController = function ($scope, $rootScope) {
$scope.vm = {
message: "Bootstrap DateTimePicker Directive",
dateTime: {}
};
$scope.$watch('change', function(){
console.log($scope.vm.dateTime);
});
@yuetyeelo2855
yuetyeelo2855 / gist:e1b9806051a5dac2fda569e40d4c8b18
Created April 11, 2016 04:51 — forked from thomseddon/gist:3511330
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});