Skip to content

Instantly share code, notes, and snippets.

View feynon's full-sized avatar

feynon.eth feynon

View GitHub Profile
### Keybase proof
I hereby claim:
* I am shermix on github.
* I am shermix (https://keybase.io/shermix) on keybase.
* I have a public key ASDVWhrni--9jT8WobsiYii4B3L8_75TPicv1aCoZHJyswo
To claim this, I am signing this object:
Order No. 0001
Brainwavz HM5
Order placed by Barun Acharya on October 17, 2019 at 0100 hrs.
Updates will be sent on registered phone number and email address ending with ***un102*@gmail.com
___________________¶¶¶¶¶¶¶¶¶¶¶¶¶__________________
___________¶¶¶¶¶¶¶¶¶___________¶¶¶¶¶¶¶¶___________
@feynon
feynon / episode.js
Created August 29, 2019 13:30 — forked from mpj/episode.js
Code from the "Dependency Injection Basics" episode of Fun Fun Function
const assert = require('assert')
function getAnimals(fetch, id) {
return fetch('http://api.animalfarmgame.com/animals/' + id)
.then(response => response.json())
.then(data => data.results[0])
}
describe('getAnimals', () => {
it('calls fetch with the correct url', () => {
@feynon
feynon / monad-stream-example.js
Created August 26, 2019 15:04 — forked from mpj/monad-stream-example.js
This is the code from Monads - episode #21 of FunFunFunction (https://www.youtube.com/playlist?list=PL0zVEGEvSaeFSwPn06GKArptSxiP1Gff8)
const fetch = require('node-fetch')
const Bacon = require('baconjs')
function getInPortuguese(word) {
// Google Translate API is a paid (but dirt cheap) service. This is my key
// and will be disabled by the time the video is out. To generate your own,
// go here: https://cloud.google.com/translate/v2/getting_started
const apiKey =
'AIzaSyB4DyRHIsNhogQXmH16YKbZfR-lTXrQpq0'
const url =
document.addEventListener("DOMContentLoaded", function(event) {
var orderModule = (function() {
var orders = {},
EST_DELIVERY = "current estimated delivery time",
estimatedDeliveryTime;
PubSub.subscribe(EST_DELIVERY, function(msg, data) {
console.log(msg);
estimatedDeliveryTime = data;
});
@feynon
feynon / solid.js
Created August 24, 2019 20:15 — forked from crizstian/solid.js
Code examples of SOLID principles for JavaScript
/*
Code examples from the article: S.O.L.I.D The first 5 priciples of Object Oriented Design with JavaScript
https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa#.7uj4n7rsa
*/
const shapeInterface = (state) => ({
type: 'shapeInterface',
area: () => state.area(state)
})
@feynon
feynon / interfaceSegregation.js
Created August 24, 2019 20:03
A client should never be forced to implement an interface that it doesn’t use or clients shouldn’t be forced to depend on methods they do not use.
const manageShapeInterface = fn => ({
type: "manageShapeInterface",
calculate: () => fn()
});
const circle = radius => {
const proto = {
radius,
type: "Circle",
area: args => Math.PI * Math.pow(args.radius, 2)
import Events from 'eventemitter3';
const modelMixin = Object.assign({
attrs: {},
set (name, value) {
this.attrs[name] = value;
this.emit('change', {
prop: name,
value: value

Keybase proof

I hereby claim:

  • I am shermix on github.
  • I am shermix (https://keybase.io/shermix) on keybase.
  • I have a public key whose fingerprint is 737D 87D0 29AC F2AA DFA4 523D 11FE E6AE CB8B 923C

To claim this, I am signing this object:

@feynon
feynon / gpg_ssh.md
Created August 17, 2019 13:23
Exporting a private GPG key from primary machine to another and setting it up on another by importing it and building trust. Last commands include steps to add it to your local git settings.
  • Exporting Keys from machine holding the primary key
hermisaurus@pop-os:~$ gpg --list-secret-keys
/home/shermisaurus/.gnupg/pubring.kbx
-------------------------------------
sec   rsa2048 2019-08-17 [SC]
      91E3CA9C218F5DA0214E8D78D6A03EC9488BECA2
uid           [ultimate] Ankesh Bharti (https://keybase.io/shermisaurus) <[email protected]>
ssb   rsa2048 2019-08-17 [E]