Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Obeng William obengwilliam

🎯
Focusing
View GitHub Profile
@obengwilliam
obengwilliam / antd_sc_example.js
Created May 5, 2020 — forked from newswim/antd_sc_example.js
Wrapping Ant Design components with Styled Components
View antd_sc_example.js
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 / mongoose connection
Created Apr 26, 2020
quickly connect to mongodb using mongoose #mongoose #mongodb
View mongoose connection
'use strict';
const mongoose = require('mongoose');
run().catch(err => console.log(err));
async function run() {
mongoose.set('useUnifiedTopology', true);
mongoose.set('useNewUrlParser', true);
@obengwilliam
obengwilliam / bundle.js
Created Apr 19, 2020 — forked from jackgill/bundle.js
A node.js script to create a bundle containing an npm package, and all of its dependencies.
View bundle.js
/*
* 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 Apr 9, 2020 — forked from tterb/README-badges.md
A collection of README badges
View README-badges.md

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@obengwilliam
obengwilliam / kubectl.md
Last active Feb 29, 2020 — forked from so0k/kubectl.md
Playing with kubectl output
View kubectl.md

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
View Activate Office 2019 for macOS VoL.md

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

View docker.md

Check logs for healthchecks in a dockerfile

docker inspect --format "{{json .State.Health }}" <container name> | jq
@obengwilliam
obengwilliam / raddit.service
Last active Sep 25, 2019 — forked from Artemmkin/raddit.service
Raddit unit file
View raddit.service
[Unit]
Description=Raddit application
After=network.target
[Service]
Type=simple
User=obeng
WorkingDirectory=/home/obeng/raddit
ExecStart=/bin/bash -lc 'puma'
Restart=always
View populateproductsimage.js
const R = require('ramda')
const assert = require('assert')
const body = '<h1>body</>'
const subject = '<h1> subject</h1>'
// function populateDefaults (profile) {
// const cloneProfile = R.clone(profile)
// if (!cloneProfile.template || !cloneProfile.template.products) {
// console.log('No template or no products')
@obengwilliam
obengwilliam / auth-authorisation.md
Last active Jul 3, 2019 — forked from omidraha/README.md
Authentication and Authorization Concepts for MicroServices
View auth-authorisation.md

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?

You can’t perform that action at this time.