Skip to content

Instantly share code, notes, and snippets.

View EngPeterShaker's full-sized avatar

Peter Shaker EngPeterShaker

View GitHub Profile
@EngPeterShaker
EngPeterShaker / function that returns a function
Created April 7, 2019 09:59
function that returns a function that returns a function
function a(a) {
function b(b) {
function c(c){
return a * b * c;
}
return c;
}
return b;
}
console.log(a(33)(22)(2)) // a* b *c
@EngPeterShaker
EngPeterShaker / clipboard.history.json
Last active March 26, 2021 10:30
Visual Studio Code Settings Sync Gist
{
"version": 2,
"clips": [
{
"value": "{\r\n \"scope\": {\r\n \"type\": \"Project\",\r\n \"projectid\": 4463\r\n },\r\n \"properties\": {\r\n \"title\": \"Project\",\r\n \"name\": \"5743\",\r\n \"url\": \"https://www.wordbee-translator.com/a/wordbee.test/Codyt/Project/Details.aspx?x=otV9bPn3PyEFCYbhlRIkdInJkG34%2facPLzesA0Xu4IjwdzF9l%2fugJA%3d%3d\",\r\n \"status\": 0,\r\n \"statust\": \"In progress\",\r\n \"statusc\": \"Open\",\r\n \"cty\": 1,\r\n \"parent\": null,\r\n \"dsid\": 5315\r\n },\r\n \"hasFiles\": true,\r\n \"hasSingleFile\": false,\r\n \"locales\": [\r\n {\r\n \"loc\": \"en\",\r\n \"locpart\": \"en\",\r\n \"name\": \"English\",\r\n \"issrc\": true,\r\n \"istrg\": true,\r\n \"isadd\": false,\r\n \"canEdit\": true,\r\n \"loc_rtl\": false\r\n },\r\n {\r\n \"loc\": \"de\",\r\n \"locpart\": \"de\",\r\n \"name\": \"German\",\r\n \"issrc\": false,\r\n \"istrg\": true,\r\n \
var x = moment().utc().format();
/* var now = moment().hours;
console.log(now.hours(x)); */
// var sendDateTime = moment().format('YYYY-MM-DD')+'T' + sendtime+':00Z';
//var timeAndDate = moment(moment().date()+' '+sendtime);
var sendtime = "13:23";
var sendDateTime2 = (moment().format('YY-MM-DD') + ' ' +sendtime);
var yty = moment.utc("2015-10-01 01:24:21").utcOffset(+"-240").format('YYYYMMDD HH:mm:ss ZZ')
@EngPeterShaker
EngPeterShaker / app.js
Last active April 16, 2018 10:33
a gist describing function inheritance using three kinds [new , .prototype , util.inherits(constructor , super constructor) ] .. and extending two child objects with [.call() and .apply()]
var util = require('util');
function Person(firstname, lastname) {
this.firstname = firstname;
this.lastname = lastname;
}
Person.prototype.greet = function() {
console.log('Hello ' + this.firstname + ' ' + this.lastname);
console.log('badge number:'+this.badgenumber);