Skip to content

Instantly share code, notes, and snippets.

View juanpujol's full-sized avatar
🇧🇷
Always Working Remotely

Juan Pujol juanpujol

🇧🇷
Always Working Remotely
View GitHub Profile
(function() {
'use strict';
angular.module('angularModelTest').factory('Account', AccountModel);
function AccountModel() {
var defaults = {
name: 'Unnamed Account'
};
@juanpujol
juanpujol / megaNumber.js
Created November 7, 2015 12:17 — forked from timgit/megaNumber.js
Large number format filter for Angular written in ES6 that rounds to the specified decimal place (defaults to 1). 1 billion => 1B, 1,490,000 => 1.5M, 999,999 => 1M
angular.module('utilsModule').filter("megaNumber", () => {
return (number, fractionSize) => {
if(number === null) return null;
if(number === 0) return "0";
if(!fractionSize || fractionSize < 0)
fractionSize = 1;
var abs = Math.abs(number);
@juanpujol
juanpujol / gist:11429be2c248f595c44d
Last active August 29, 2015 14:10
Meplis Filepicker (basic config)
<button meplis-filepicker="upload files">
Open Meplis Files
</button>
@juanpujol
juanpujol / gist:6613b8fb2a7cbf761826
Created November 26, 2014 16:43
Meplis Filepicker (no config)
<button meplis-filepicker>
Open Meplis Files
</button>
@juanpujol
juanpujol / gist:3bf9e10da88320823e3d
Last active August 29, 2015 14:10
Meplis Filepicker: Media URL (config object)
<button meplis-filepicker="url"
url="{ providers: 'youtube vimeo' }">
Media Url
</button>
<button meplis-filepicker="url">
Media Url
</button>
@juanpujol
juanpujol / gist:2e7803d7b659480dd499
Last active August 29, 2015 14:10
Meplis Filepicker: Upload (config object)
<button meplis-filepicker="upload"
upload="{
multiple: 8,
types: 'jpg jpeg !png',
sizeLimit: 4,
path: 'App/Filepicker Demo'
}">
Upload a File
</button>
@juanpujol
juanpujol / gist:09e451486d3b4aeb7d13
Last active August 29, 2015 14:10
Upload (no config)
<button meplis-filepicker="upload"
upload="{ path: 'Apps/Filepicker Demo' }">
Uploads a File
</button>
@juanpujol
juanpujol / gist:2e4ea13d956764ed3101
Last active August 29, 2015 14:10
Meplis Filepicker: Files (not config)
<button meplis-filepicker="files">
Open Meplis Files
</button>
@juanpujol
juanpujol / gist:f72d2cbea5d33ad7e54e
Last active August 29, 2015 14:10
Meplis Filepicker: Files (multiple: 5)
<button meplis-filepicker="files"
files="{ multiple: 5, types: 'jpg jpeg !gif' }">
Open Meplis Files
</button>