Skip to content

Instantly share code, notes, and snippets.

View schinsue's full-sized avatar

Sergio Chin-Sue schinsue

View GitHub Profile
@schinsue
schinsue / Tech_spec.md
Last active June 3, 2024 15:52
Tech Spec Template

Background

This tech spec is for the "Discount feature", it allows users to configure discounts/pricing tiers on the menu products/carts so they can entice their customers to buy products.

Proposed Solution

1. Data model changes

Here's an outline for the data model changes I would make. This is a rough sketch, so please don't use this in production.

defmodule BeExercise.DatabaseSeeder do
alias BeExercise.Repo
alias BeExercise.Accounts
alias BeExercise.Accounts.User
alias BeExercise.Finances
alias Faker.{Person, Internet}
alias Ecto.Multi
@currencies Finances.get_current_known_currencies()
@schinsue
schinsue / glassdoor.txt
Created March 29, 2022 08:18 — forked from se79419ed/glassdoor.txt
bookmarklet to remove hardsell overlay from glassdoor.com
javascript:(function(){
document.getElementById("ContentWallHardsell").remove();
document.getElementsByTagName("body")[0].style.overflow = "scroll";
let style = document.createElement('style');
style.innerHTML = `
#LoginModal {
display: none!important;
}
`;
document.head.appendChild(style);
@schinsue
schinsue / doom.txt
Created July 8, 2020 19:11 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@schinsue
schinsue / permute.js
Created April 15, 2019 16:28 — forked from customcommander/permute.js
Return all permutations of a string
/**
* Return all permutations of given string.
*
* @example
* permute('abc');
* //=> ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
* @param str {String}
* @return {Array}
*/
function permute(str) {
@schinsue
schinsue / AppDelegate.m
Created February 6, 2019 11:10 — forked from andrey-skl/AppDelegate.m
How to enable logging in production build of React Native app
...
#import "RCTLog.h"
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTSetLogThreshold(RCTLogLevelInfo);
...
@schinsue
schinsue / mapDispatchToProps.md
Created January 8, 2019 10:03 — forked from heygrady/mapDispatchToProps.md
Redux containers: mapDispatchToProps

Redux containers: mapDispatchToProps

This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.

@schinsue
schinsue / Elixir_Formatter.md
Created February 5, 2018 13:54 — forked from dberget/Elixir_Formatter.md
Some notes on using Elixir's code formatter

Example of .formatter.exs file

[
  inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"],
  locals_without_parens: [
    # Kernel
    inspect: 1,
    inspect: 2,

    # Phoenix
@schinsue
schinsue / Guardian JWT.md
Created February 3, 2018 21:09 — forked from nikneroz/Guardian JWT.md
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.