Skip to content

Instantly share code, notes, and snippets.

View EngPeterShaker's full-sized avatar

Peter Shaker EngPeterShaker

View GitHub Profile
@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);
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 / 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 \
@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 / longestWord.js
Created February 25, 2020 11:18
find longest word
const str = sen.replace(/[^a-zA-Z ]/g, ""); // replace strange characters
const words = str.split(' '); // convert to array of strings
const sorted = words.sort((a, b) => b.length - a.length); // sort descending according string length
return sorted[0]
console.log('%cHellooo',"font-weight:bold ; color: cyan ; font-size:18px")
* `https://githowto.com/aliases`
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.pl pull
git config --global alias.ps push
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.type 'cat-file -t'
@EngPeterShaker
EngPeterShaker / yarn.md
Created January 20, 2021 15:26
Useful aliases for Yarn

Basic Commands

alias y="yarn"
alias yi="yarn init -y"

Install And Remove Packages

Ubuntu To Mac OS Mojave theme

Mc OS Mojave Ubuntu Look alike


Pre-requisites

  • sudo apt update
  • sudo apt install gnome-tweaks
  • sudo apt-get install gir1.2-clutter-1.0 gir1.2-clutter-gst-3.0 gir1.2-gtkclutter-1.0
@EngPeterShaker
EngPeterShaker / readme.md
Created July 26, 2021 15:47 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph