Skip to content

Instantly share code, notes, and snippets.

View akhilome's full-sized avatar
🌚
poupon

Kizito Akhilome akhilome

🌚
poupon
View GitHub Profile
// ABC...Z
const alphaUpper = Array(26)
.fill('')
.map((_, i) => String.fromCharCode(65 + i))
.join('');
// abc...z
const alphaUpper = Array(26)
.fill('')
.map((_, i) => String.fromCharCode(65 + i))
{
"version": 2,
"routes": [
{
"src": "/v1/logs/(.*)",
"dest": "src/routes/logger.route.ts?slug=$1",
"methods": ["OPTIONS", "POST", "PUT"]
},
{
"src": "/(?<slug>[^/]*)/?",
@akhilome
akhilome / express-vercel.md
Last active January 16, 2024 11:49
express-vercel

Setting Up Vercel for APIs with Express

This gist would offer a step-by-step guide of some sort for quickly setting up a "serverless" API using expressjs, and Vercel's Now platform for local development with now dev and eventual prod deployment now --prod

Install Now CLI

If you haven't already, install now's cli tool globally on your development environment:

@akhilome
akhilome / so.md
Last active April 13, 2020 14:54
Handy S/O links
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Place in ~/Library/LaunchAgents/ -->
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.akhilome.CapslockLShift</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/hidutil</string>
const fs = require('fs');
const { join } = require('path');
const { promisify } = require('util');
const shell = require('child_process').execSync;
const readDir = promisify(fs.readdir);
const tempPath = join(__dirname, 'temp');
const distPath = join(__dirname, 'dist');
readDir(__dirname)
@akhilome
akhilome / get-slack-keys.md
Last active October 28, 2019 10:41
How to get your slack user and bot tokens for envbot

Visit Slack's API landing page

slack-lp

Click to create a new app

Specify a Name & Create the App

app-name

@akhilome
akhilome / noted.md
Last active April 14, 2019 05:06
Random scripts/statements to take note of

Open Heroku Provisioned Postgres DB

heroku pg:psql <postgresql-db-name> -a <app-name>

To Exit

\q
import chai from 'chai';
import 'chai/register-should';
import chaiHttp from 'chai-http';
import app from '../../src/app.js';
import { publications, articles } from '../mockData';
chai.use(chaiHttp);
describe('GET all articles for a particular publication', () => {
@akhilome
akhilome / .gitforget.md
Last active April 13, 2019 12:21
Remove accidentally committed files from git

Add files to be forgotten to your .gitignore file:

echo "[filename1.ext] \n[filename2.ext] \n[evenafulldirectory/]" >> .gitignore

From root of the repo run:

git rm -r --cached . &gt; /dev/null &amp;&amp; git add --all