Skip to content

Instantly share code, notes, and snippets.

View schinsue's full-sized avatar

Sergio Chin-Sue schinsue

View GitHub Profile
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.

@schinsue
schinsue / how-to-squash-commits-in-git.md
Created January 19, 2018 17:13 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date: