Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
class MyPromise { | |
constructor(executor) { | |
if (typeof executor !== 'function') { | |
throw new Error('Executor must be a function'); | |
} | |
// Internal state. `$state` is the state of the promise, and `$chained` is | |
// an array of the functions we need to call once this promise is settled. | |
this.$state = 'PENDING'; | |
this.$chained = []; |
class MyPromise { | |
constructor(executor) { | |
if (typeof executor !== 'function') { | |
throw new Error('Executor must be a function'); | |
} | |
// Internal state. `$state` is the state of the promise, and `$chained` is | |
// an array of the functions we need to call once this promise is settled. | |
this.$state = 'PENDING'; | |
this.$chained = []; |
class PromiseSimple { | |
constructor(executionFunction) { | |
this.promiseChain = []; | |
this.handleError = () => {}; | |
this.onResolve = this.onResolve.bind(this); | |
this.onReject = this.onReject.bind(this); | |
executionFunction(this.onResolve, this.onReject); | |
} |
https://jason.pureconcepts.net/2015/10/install-apache-php-mysql-mac-os-x-el-capitan/ | |
https://jason.pureconcepts.net/2012/10/install-apache-php-mysql-mac-os-x/ | |
https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx-10-11-el-capitan/ | |
http://www.alphansotech.com/blogs/setup-apache-mysql-php-phpmyadmin-mac-osx/ | |
https://mallinson.ca/osx-web-development/ | |
https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx-10-11-el-capitan/ | |
##Apache httpd file location | |
/etc/apache2 |
#credit: https://github.com/crosbymichael | |
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
/***************************************************************** | |
* onMessage from the extension or tab (a content script) | |
*****************************************************************/ | |
chrome.runtime.onMessage.addListener( | |
function(request, sender, sendResponse) { | |
if (request.cmd == "any command") { | |
sendResponse({ result: "any response from background" }); | |
} else { | |
sendResponse({ result: "error", message: `Invalid 'cmd'` }); | |
} |
/** | |
* | |
Find longest sequence of zeros in binary representation of an integer. | |
*/ | |
public class BinaryLongestZeroSequence { | |
/** | |
* worst-case time complexity is O(log(N)); | |
* number of bits = log(N) ==> worst case is O(N) | |
* @param N |
/* | |
* Code snippet for posting tweets to your own twitter account from node.js. | |
* You must first create an app through twitter, grab the apps key/secret, | |
* and generate your access token/secret (should be same page that you get the | |
* app key/secret). | |
* Uses oauth package found below: | |
* https://github.com/ciaranj/node-oauth | |
* npm install oauth | |
* For additional usage beyond status updates, refer to twitter api | |
* https://dev.twitter.com/docs/api/1.1 |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
function compose(...fnArgs) { | |
const [first, ...funcs] = fnArgs.reverse(); | |
return function(...args) { | |
return funcs.reduce((res, fn) => fn(res), first(...args)); | |
}; | |
} |