Skip to content

Instantly share code, notes, and snippets.

View obengwilliam's full-sized avatar
🎯
Focusing

Obeng William obengwilliam

🎯
Focusing
View GitHub Profile
@obengwilliam
obengwilliam / Isomap
Created November 16, 2020 10:54 — forked from Mashimo/ Isomap
Data dimensionality reduction via isomap
Isomap is a nonlinear dimensionality reduction method.
The algorithm provides a simple method for estimating the intrinsic geometry of a data manifold based on a rough estimate
of each data point’s neighbours
@obengwilliam
obengwilliam / antd_sc_example.js
Created May 5, 2020 08:17 — forked from newswim/antd_sc_example.js
Wrapping Ant Design components with Styled Components
import { Link } from 'react-router-dom'
import { Badge, Col, Menu } from 'antd'
const StyledBadge = styled(Badge)`
.ant-badge-count {
background-color: #7ECBBF;
color: white;
box-shadow: 0 0 0 1px #d9d9d9 inset;
}
`
@obengwilliam
obengwilliam / bundle.js
Created April 19, 2020 17:12 — forked from jackgill/bundle.js
A node.js script to create a bundle containing an npm package, and all of its dependencies.
/*
* This script will download a package (and all of its dependencies) from the
* online NPM registry, then create a gzip'd tarball containing that package
* and all of its dependencies. This archive can then be copied to a machine
* without internet access and installed using npm.
*
* The idea is pretty simple:
* - npm install [package]
* - rewrite [package]/package.json to copy dependencies to bundleDependencies
* - npm pack [package]
@obengwilliam
obengwilliam / README-badges.md
Created April 9, 2020 03:55 — forked from tterb/README-badges.md
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@obengwilliam
obengwilliam / kubectl.md
Last active February 29, 2020 18:01 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@obengwilliam
obengwilliam / Activate Office 2019 for macOS VoL.md
Created February 16, 2020 21:29 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@obengwilliam
obengwilliam / raddit.service
Last active September 25, 2019 22:07 — forked from Artemmkin/raddit.service
Raddit unit file
[Unit]
Description=Raddit application
After=network.target
[Service]
Type=simple
User=obeng
WorkingDirectory=/home/obeng/raddit
ExecStart=/bin/bash -lc 'puma'
Restart=always
@obengwilliam
obengwilliam / auth-authorisation.md
Last active July 3, 2019 00:16 — forked from omidraha/README.md
Authentication and Authorization Concepts for MicroServices

auth with microservices

Authorization and Authentication are hard. when you only have to implement them once (as you do within a monolith) instead of over and over again, it makes the developer happy :-), and maybe leads to less implementation failures.

When you have a bunch of microservices, this is something that has to be considered.

Implement it once or in every microservice, or something in between?

@obengwilliam
obengwilliam / README.md
Last active April 15, 2020 14:33 — forked from rantav/README.md
Find slow queries in mongo DB #mongodb #performance

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@obengwilliam
obengwilliam / README.md
Created February 14, 2019 03:50 — forked from boneskull/README.md
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js