Skip to content

Instantly share code, notes, and snippets.

View behnood-eghbali's full-sized avatar
🎯
Focusing

Behnood Eghbali behnood-eghbali

🎯
Focusing
View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active July 23, 2024 21:25
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
const getSecret = (secret) => {
return {
get: () => secret
};
};
test('Closure for object privacy.', assert => {
const msg = '.get() should have access to the closure.';
const expected = 1;
const obj = getSecret(1);
@ericelliott
ericelliott / partial-apply.js
Last active October 27, 2020 07:09
Generic Partial Application Function https://jsbin.com/biyupu/edit?html,js,output
// Generic Partial Application Function
// https://jsbin.com/biyupu/edit?html,js,output
// https://gist.github.com/ericelliott/f0a8fd662111ea2f569e
// partialApply(targetFunction: Function, ...fixedArgs: Any[]) =>
// functionWithFewerParams(...remainingArgs: Any[])
const partialApply = (fn, ...fixedArgs) => {
return function (...remainingArgs) {
return fn.apply(this, fixedArgs.concat(remainingArgs));
};
@ericelliott
ericelliott / secret.js
Last active October 27, 2020 07:08
Secret - creates closures with secret messages. https://jsbin.com/hitusu/edit?html,js,output
// Secret - creates closures with secret messages.
// https://gist.github.com/ericelliott/f6a87bc41de31562d0f9
// https://jsbin.com/hitusu/edit?html,js,output
// secret(msg: String) => getSecret() => msg: String
const secret = (msg) => () => msg;
test('secret', assert => {
const msg = 'secret() should return a function that returns the passed secret.';
@ericelliott
ericelliott / dependency-injection.js
Created October 2, 2016 01:02
Dependency Injection
const consumer = dependency => dependency.doSomething();
const realDependency = {
doSomething () {
console.log('did something!');
}
};
consumer(realDependency);
@zcaceres
zcaceres / Eyeballing-This.md
Last active August 17, 2023 23:38
Understanding Binding and 'this' in Javascript by zach.dev

How to Eyeball Your ‘This’ Context in Javascript

The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.

This is all about where a function is invoked. Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!

Nope.

@jimmywarting
jimmywarting / readme.md
Last active July 23, 2024 18:45
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active July 18, 2024 08:32
Eric Elliott's Master the JavaScript Interview Series
@Geoff-Ford
Geoff-Ford / composing-software.md
Last active July 18, 2024 08:32
Eric Elliott's Composing Software Series

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

@sathiyaseelan
sathiyaseelan / golang_setup.md
Last active April 1, 2024 18:51
Basics to setup a golang project repo in your local

Simple Guide to setup Golang in your Mac and clone a repo.

Setup Go and workspace

Type go in terminal, to verify the installation.

  • Create a Go workspace and set GO PATH