Skip to content

Instantly share code, notes, and snippets.

View godolatunji's full-sized avatar

Olatunji Ayodabo godolatunji

  • Nigeria
View GitHub Profile
user nginx;
worker_processes auto;
worker_cpu_affinity auto;
# Change the default thread pool settings
thread_pool default threads=2 max_queue=16384;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
@godolatunji
godolatunji / BalsamiqForever.py
Created July 26, 2022 03:08 — forked from HoussemNasri/BalsamiqForever.py
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
@godolatunji
godolatunji / delete-likes-twitter.md
Last active April 3, 2022 10:36
delete all your likes from your twitter profile
@godolatunji
godolatunji / int2ip.js
Created August 3, 2020 04:24 — forked from jppommet/int2ip.js
javascript conversion from ip address to long integer and vice versa
function int2ip (ipInt) {
return ( (ipInt>>>24) +'.' + (ipInt>>16 & 255) +'.' + (ipInt>>8 & 255) +'.' + (ipInt & 255) );
}
{
"extends": [
"airbnb",
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": [
"react"
],
@godolatunji
godolatunji / simple-promise-retry.js
Created August 28, 2019 15:26 — forked from briancavalier/simple-promise-retry.js
A few general patterns for retries using promises
function keepTrying(otherArgs, promise) {
promise = promise||new Promise();
// try doing the important thing
if(success) {
promise.resolve(result);
} else {
setTimeout(function() {
keepTrying(otherArgs, promise);
const application = await NestFactory.create(ApplicationModule);
function availableRoutesString() {
return application.httpAdapter.instance._router.stack
.filter(r => r.route)
.map(r => Object.keys(r.route.methods)[0].toUpperCase().padEnd(7) + r.route.path)
.join("\n")
}
console.log(availableRoutesString());
@godolatunji
godolatunji / upgrade-postgres-9.5-to-9.6.md
Created January 6, 2019 04:12 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04

TL;DR

Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
@godolatunji
godolatunji / ReverseString.java
Created November 30, 2018 08:28
Java: Reverse String without stacks
import java.util.*;
class ReverseString {
public static void main(String[] args) {
String s = "Hello world!";
String[] arr = s.split("");
List<String> list = Arrays.asList(arr);
Collections.reverse(list);
Object[] ar = list.toArray();
s = Arrays.toString(ar);
@godolatunji
godolatunji / docker-cleanup-resources.md
Created March 19, 2018 09:47 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm