This file contains hidden or 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
| addJSON (json) { | |
| let self = this; | |
| let formData = new FormData(); | |
| formData.append('json', JSON.stringify(json)); | |
| formData.append('file', avatar); | |
| let xhr = $.ajax({ |
This file contains hidden or 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
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| messagesInput := []string{"Name(s): ", "First name: ", "Last name: ", "Age: "} |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "time" | |
| ) | |
| func main() { | |
| var wg sync.WaitGroup |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "runtime" | |
| "sync" | |
| "time" | |
| ) | |
| func main() { |
This file contains hidden or 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
| app.factory('SocketIO', function ($rootScope) { | |
| var socket = io.connect(); | |
| return { | |
| on: function (eventName, callback) { | |
| socket.on(eventName, function () { | |
| var args = arguments; | |
| $rootScope.$apply(function () { | |
| callback.apply(socket, args); | |
| }); | |
| }); |
This file contains hidden or 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
| var filters = {}; | |
| filters.orderByObject = function() { | |
| return function(items, field, reverse) { | |
| var filtered = []; | |
| angular.forEach(items, function(item) { | |
| filtered.push(item); | |
| }); |
This file contains hidden or 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
| /* | |
| Dependencies | |
| http://sorgalla.com/jcarousel/ | |
| Implementation | |
| <carousel ng-model="Object.property" elements="elements"></carousel> | |
This file contains hidden or 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
| directives.uploadDrop = function (){ | |
| return { | |
| require: '?ngModel', | |
| restrict: 'E', | |
| template: '<div class="input-file" style="width: 150px;"><span class="glyphicon glyphicon-picture"></span></div>', | |
| link: function (scope, element, attrs, ngModel){ | |
| if (!ngModel) return; | |
| element.bind('drop', function (event) { |
This file contains hidden or 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
| // Bootstrap is used for visual effects | |
| /* | |
| HTML | |
| <ng-upload ng-model="file"></ng-upload> | |
| <ng-upload ng-model="Object.file"></ng-upload> | |
| */ | |
| var directives = { | |
| ngUpload: function () { |
NewerOlder