Skip to content

Instantly share code, notes, and snippets.

View fxck's full-sized avatar

Aleš fxck

View GitHub Profile
_postGetHandler: function(method, url, data, callback, type) {
var self = this;
if ($.isFunction(data)) {
type = type || callback;
callback = data;
data = undefined;
}
self.ajax({
currencyFilter.$inject = ['$locale'];
function currencyFilter($locale) {
var formats = $locale.NUMBER_FORMATS;
return function(amount, currencySymbol){
if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM;
return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2).
replace(/\u00A4/g, currencySymbol);
};
}
@fxck
fxck / gist:7028338
Last active December 25, 2015 19:29
ui-bootstraps modal's backdrop windowClass
index 898b8a7..a2dd010 100644 (file)
--- a/www/public/js/lib/ui/ui-bootstrap.js
+++ b/www/public/js/lib/ui/ui-bootstrap.js
@@ -147,6 +147,8 @@ angular.module('ui.bootstrap.modal', [])
replace: true,\r
templateUrl: 'template/modal/backdrop.html',\r
link: function (scope, element, attrs) {\r
+ scope.windowClass = attrs.windowClass || '';\r
+\r
//trigger CSS transitions\r
@fxck
fxck / gist:7355187
Created November 7, 2013 14:15
ui bootstrap modal with windowClass applying to backdrop and setWindowClass() method
angular.module('ui.bootstrap.modal', [])
/**
* A helper, internal data structure that acts as a map but also allows getting / removing
* elements in the LIFO order
*/
.factory('$$stackedMap', function () {
return {
createNew: function () {
// jo
if (a == b) {
if (c == d) {
}
if (e == f) {
}
@fxck
fxck / gist:7804798
Last active December 30, 2015 08:49
costlocker's donuts
/*
atrs:
size, lineWidth, bg, bc, val
*/
app.directive('clDonut', function() {
return {
restrict: 'E',
template: '<canvas></canvas>',
replace: true,
link: function(scope, el, attrs) {
{
"3/7": {[
"project_main",
]
},
"4/7": {
"1/6": [
"tracked_estimated",
"estimated_profit",
"revenue",
@fxck
fxck / gist:d65255218de3611df3cd
Created January 13, 2015 20:53
Adjusted parser to render paragraphs which only contain a single image without the paragraph. So instead <p><img ...></p> it just renders <img ...>
<?php
/**
* Adjusted parser to render paragraphs which only contain a single image without the paragraph.
*
* So instead
* <p><img ...></p>
*
* it just renders
* <img ...>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="lib/angular2.js"></script>
</head>
<body>
<hello>
Loading...
import {bootstrap} from 'angular2/angular2';
import {ROUTER_BINDINGS} from 'angular2/router';
import {HTTP_BINDINGS} from 'angular2/http';
import {App} from './app/app';
bootstrap(App, [ROUTER_BINDINGS, HTTP_BINDINGS]);