Skip to content

Instantly share code, notes, and snippets.

function setTimestamp() {
var formattedDate = Utilities.formatDate(new Date(), "GMT+2", "yyyy-MM-dd HH:mm:ss");
return formattedDate;
}
var mapper = {
'client': {
col: 1,
parse: function(input){
@adasq
adasq / google app script trigger.js
Created August 4, 2015 18:52
google app script trigger.js
var sheet = SpreadsheetApp.getActive();
ScriptApp.newTrigger("myFunction")
.forSpreadsheet(sheet)
.onEdit()
.create();
var response = UrlFetchApp.fetch("http://jsonplaceholder.typicode.com/posts/");
Logger.log(response);
@adasq
adasq / gist:2cd367081c3359613681
Created March 15, 2015 21:27
grunt file expand
grunt.registerTask('bs', 'sadas', function(){
var result2, result3;
var realPaths = grunt.file.expand({
cwd: 'project'
},'**/*.js');
result2 = _.map(realPaths, function(path){
var parts = path.split('/');
<!DOCTYPE html>
<!--
Created using JS Bin
http://jsbin.com
Released under the MIT license: http://jsbin.mit-license.org
-->
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
@adasq
adasq / gist:63ff1bb77c180c62a469
Last active August 29, 2015 14:04
angular.modal
var modalController = function($scope, $modalInstance, arg) {
$scope.arg = arg;
$scope.submit = function() {
$modalInstance.close({});
};
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
};
@adasq
adasq / gist:b9f85fbebff2f7dee211
Created April 30, 2014 14:08
own lib ANGULAR
angular.module("ui.mylib", ["ui.mylib.tpls", "ui.mylib.example"]);
angular.module("ui.mylib.tpls", ["template/example.html"]);
angular.module("template/example.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("template/example.html",
"<b>to jest przykladowy template</b>");
}]);
angular.module("ui.mylib.example", [])
.directive('example', function () {
@adasq
adasq / gist:885b0a97cf26f898959e
Created April 29, 2014 21:00
ANGULAR JS ALERT
var AlertManager = function(){
var template = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
this.setText = function(type, text){
$scope.alert = {text: $sce.trustAsHtml(template+text), type: (type || 'danger')};
};
this.setDangerAlert = function(text){
this.setText('danger',text);
};
this.setSuccessAlert = function(text){
this.setText('success',text);
var Pesel = {
getDateByPesel: function (pesel) {
var l, c, birth = [
pesel.substr(0, 2),
pesel.substr(2, 2),
pesel.substr(4, 2)
],
isOdd = function (c) {
return (c % 2 === 1);
}, years = {