This file contains 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
<?php | |
// src/UsersManager.php | |
namespace Vendor\Users; | |
class UsersManager { | |
private $users = array(); | |
/** | |
* Add a user to the list | |
* @return User|boolean Return the created user object, or false if the user is not valid |
This file contains 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
'use strict'; | |
/** | |
* Returns a clean copy of the provided object, in order to JSON.stringify it for example. | |
* | |
* It removes recursively methods and cyclic objects. | |
* Cyclic objects are references to a parent object of the property, for example: a.b.c = a; | |
* References to non-parent objects are kept, for example: a.b.c = 'hello'; a.d = a.b; | |
* @param any obj Any variable. When obj is not an object, it is returned as-is. | |
* @param array parents Parents list, for internal use. |
This file contains 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
[...] | |
// The following *-min tasks produce minified files in the dist folder | |
cssmin: { | |
options: { | |
root: '' // customisation to add font files from CSS libraries | |
} | |
}, | |
[...] | |
copy: { |
This file contains 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
/** | |
* Get a date as 'YYYY-MM-DD HH:MM:SS' as GMT, and returns the same date according to the browser's timezone, i.e. GMT+n. | |
* The returned date is a string, with the locale format. | |
* @param string dateString The date as 'YYYY-MM-DD HH:MM:SS' | |
* @param bool withHour If false (default), the 'hour' part is excluded from the returned string | |
* @return string The date/time according to the browser's locale timezone and format. | |
* @example gmtToLocaleDate('2014-10-31 21:52:17', true) returns '31/10/2014 21:52:17' (according to my French browser locale, as october is GMT+1) | |
* @example gmtToLocaleDate('2014-05-31 21:52:17', true) returns '31/05/2014 23:52:17' (as May is GMT+2) | |
*/ | |
var gmtToLocaleDate = function(dateString, withHour) { |
This file contains 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
<?php | |
/** | |
* Shortcodes to create responsive columns in the WordPress content, using Twitter Bootstrap. | |
* For further details about sizes, offset and clearfix, take a look at http://getbootstrap.com/css/#grid | |
*/ | |
/** | |
* Shortcode to add a row containing columns | |
* Parameters: | |
* - classes: additional classes |
This file contains 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
'use strict'; | |
angular.module('promiseTestApp') | |
.controller('LoginWithCallbacksCtrl', function ($scope, Connection) { | |
$scope.connect = function(login, password) { | |
$scope.showLoader(); | |
Connection.get( | |
{'login': login, 'password': password}, | |
function() { // success | |
$scope.notification('Connection successful'); |
This file contains 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
'use strict'; | |
angular.module('testBlueimpApp') | |
.controller('UploaderCtrl', function ($scope, fileUpload) { | |
var baseUrl = 'http://localhost/test-upload/index.php'; | |
$scope.options = { | |
autoUpload: true, | |
maxChunkSize: 1024 * 1024, // = 1Mo | |
add: function(e, data) { |
This file contains 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
<form id="fileupload" method="POST" enctype="multipart/form-data" ng-controller="UploaderCtrl" file-upload="options" ng-class="{'fileupload-processing': processing() || loadingFiles}"> | |
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> | |
<div class="row fileupload-buttonbar"> | |
<div class="col-lg-7"> | |
<!-- The fileinput-button span is used to style the file input field as button --> | |
<span class="btn btn-success fileinput-button" ng-class="{disabled: disabled}"> | |
<i class="glyphicon glyphicon-plus"></i> | |
<span>Add files...</span> | |
<input type="file" name="files[]" multiple ng-disabled="disabled"> | |
</span> |
This file contains 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
'use strict'; | |
angular.module('testBlueimpApp') | |
.controller('FileDestroyCtrl', function ($scope, $http) { | |
var file = $scope.file, | |
state; | |
if (file.url) { | |
file.$state = function () { | |
return state; | |
}; |
This file contains 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
'use strict'; | |
angular.module('testBlueimpApp') | |
.controller('UploaderCtrl', function ($scope, $http) { | |
var uploadScriptUrl = 'http://localhost/test-upload/index.php'; | |
$scope.options = { | |
url: uploadScriptUrl | |
}; | |
$scope.loadingFiles = true; | |
$http.get(uploadScriptUrl) |