Skip to content

Instantly share code, notes, and snippets.

View geoyws's full-sized avatar

George Yong geoyws

View GitHub Profile
@geoyws
geoyws / replace.sh
Created August 9, 2022 02:33 — forked from hlissner/replace.sh
Bulk search & replace with ag (the_silver_searcher)
# ag <https://github.com/ggreer/the_silver_searcher>
# usage: ag-replace.sh [search] [replace]
# caveats: will choke if either arguments contain a forward slash
# notes: will back up changed files to *.bak files
ag -0 -l $1 | xargs -0 perl -pi.bak -e "s/$1/$2/g"
# or if you prefer sed's regex syntax:
ag -0 -l $1 | xargs -0 sed -ri.bak -e "s/$1/$2/g"
@geoyws
geoyws / ruby-2-3-install.sh
Created August 4, 2022 17:09 — forked from mdesantis/ruby-2-3-install.sh
Install Ruby 2.3 on Ubuntu 19.10 using asdf (ruby-build)
#!/bin/bash
# It assumes [asdf](https://github.com/asdf-vm/asdf) to be installed
# and asdf plugin for Ruby to be added
set -exuo pipefail
sudo apt install libreadline-dev
wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
tar -xzf openssl-1.0.2u.tar.gz
@geoyws
geoyws / bp.md
Last active December 23, 2020 02:38
Sapiensia Commerce Business Plan

Commerce Business Plan

Executive Summary

  • Commerce aims to be the simple, ultra-low-cost e-commerce platform with an emphasis on managing accounts for you e.g. recurring payments, split billings, memberships etc.
  • Commerce provides extensive APIs that companies can use instead of build themselves.
  • We don't want people to have to sink huge costs (e.g. Shopify, Chargebee) just to be able to use a simple service for one-off or recurring payments.
  • Everyday Joes can simply rock up to our site, sign-up for RM1, and transact via credit card for a 3.5% + RM1 charge (can be further mitigated via nego for better rates with Stripe to perhaps 2.2% and RM0.50).
  • Heavy Users who could save on admin and tech fees:
  • recurring food delivery services,
@geoyws
geoyws / CypressGuide.md
Last active September 9, 2020 08:29
Getting started with Cypress

Updated 3rd Sept 2020

  1. yarn add cypress -D

  2. yarn run cypress open

    2.1 Wait for cypress to completely load and then close it. We're just running this to instantiate the files we need.

  3. Follow these steps for TypeScript or basically just follow the below:

3.1. Basically make sure that tsconfig.json exists in the ./cypress folder with the minimum below:

@geoyws
geoyws / .sh
Last active January 10, 2020 06:31
PSQL Docker Installation
```
sudo mkdir -p ~/work/data/psql11 && \
sudo docker run \
--name ifca.training.psql11 \
-e POSTGRES_PASSWORD=abc123 \
-e PGDATA=pgdata \
-p 5432:5432 \
-v ~/work/data/psql11:/var/lib/postgresql/data/pgdata \
--restart unless-stopped \
-d \
#!/bin/sh
#
# Adam Sharp
# Aug 21, 2013
#
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`.
#
# Does the inverse of `git submodule add`:
# 1) `deinit` the submodule
# 2) Remove the submodule from the index and working directory
@geoyws
geoyws / react.html
Created October 6, 2016 04:32 — forked from RickWong/react.html
Write React apps in 1 HTML file.
<html>
<body>
<div id="react-root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.7.7/babel.min.js"></script>
<script id="react-app" type="text/template">
const App = ({name}) => {
@geoyws
geoyws / step0.js
Last active June 5, 2018 08:22 — forked from shimondoodkin/goals.md
plain vanilla node.js intro tutorial to learn a lot in the shortest time.
//go to nodejs.org and copy the simple hello world code to a file.
// test it go with the browser to http://127.0.0.1:1337/
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1'); // remove the ip argument from listen. otherwise it will bind only to this ip address. and you wont be able to connect if it runs on a server.
console.log('Server running at http://127.0.0.1:1337/');
@geoyws
geoyws / alpsregistration
Last active August 29, 2015 14:06
For the VLT ALPS program
for (var i = 1; i < 100; i++) {
if (i%3 == 0 && i%5 == 0) {
console.log("AnonymousLlama");
} else if (i%3 == 0) {
console.log("Anonymous");
} else if (i%5 == 0) {
console.log("Llama");
} else {
console.log(i);
}