Skip to content

Instantly share code, notes, and snippets.

View meetKazuki's full-sized avatar
💭
Coder's block..

Desmond meetKazuki

💭
Coder's block..
View GitHub Profile
@meetKazuki
meetKazuki / model-migration.script.ts
Created April 7, 2024 08:26 — forked from pipethedev/model-migration.script.ts
Convert object model to knex migrations
import fs from 'fs';
import path from 'path';
import { exec } from 'child_process';
enum KnexMigrationType {
Id = 'uuid',
String = 'string',
Number = 'integer',
Float = 'float',
Array = 'enum',
@meetKazuki
meetKazuki / script.sh
Created August 2, 2022 14:04 — forked from supercede/script.sh
AWS Cloudformation User Data script in install nodejs, pm2, codedeploy agent and set env variables from AWS parameter store (or AWS secrets manager if you tweak the aws command). AWS Parameter Store uses parameter hierarchies to organize and manage parameter access in an easier manner.
UserData:
"Fn::Base64": !Sub |
#!/bin/bash
yum install ruby -y
wget https://aws-codedeploy-${AWS::Region}.s3.${AWS::Region}.amazonaws.com/latest/install
chmod +x ./install
./install auto
cd /tmp
yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
systemctl enable amazon-ssm-agent
@meetKazuki
meetKazuki / factorial.pas
Created May 5, 2021 20:55
A Pascal program that reads a positive integer N and tabulate the factorials of the number from 1 to N.
(*
WIP: This solution uses recursive factorial definition.
At the moment, this solution does not satisfy the complete requirements
of the problem statement. If I'm given enough time, I can implement a
solution that will match the specifications.
*)
program factorial;
function factorial(number: integer): longint;
@meetKazuki
meetKazuki / git-pushing-multiple.rst
Created August 31, 2020 10:29 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@meetKazuki
meetKazuki / paystack-implementation.js
Created May 20, 2020 17:51 — forked from alabobriggs/paystack-implementation.js
Simple JS implementation for paystack
makeInvestment: async () => {
/*
add this script inside your page head tag <script async src="https://js.paystack.co/v1/inline.js" />
this will make the PasystackPop available
*/
const handler = PaystackPop.setup({
key: process.env.PAYSTACK_LIVE_API,
email: 'user@example.com',
'use strict';
// Dependencies
const gcloud = require('google-cloud', {
projectId: 'sara-bigquery',
keyfileName: 'keyfile.json'
});
const vision = gcloud.vision();
const fs = require('fs');
const async = require('async');
@meetKazuki
meetKazuki / windows-terminal-profile.json
Last active March 6, 2023 13:08 — forked from shanselman/settings.json
Scott Hanselman windows terminal profile settings
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"globals": {
"alwaysShowTabs": true,
"defaultProfile": "{79285a8e-036c-446f-8a9c-78994e34cf85}",
"initialCols": 120,
"initialRows": 30,
"requestedTheme": "dark",
"keybindings": [
{
@meetKazuki
meetKazuki / count-change.js
Created April 14, 2019 01:11
Some Qualified.io Code Snippets
/**
* Write a function that counts how many different ways you can make
* change for an amount of money, given an array of coin denominations.
*
* The order of coins does not matter
*/
function countChange(money, coins) {
let waysOfDoingNcents = [];
for (let i = 0; i <= money; i++)
waysOfDoingNcents[i] = 0;