Skip to content

Instantly share code, notes, and snippets.

View jaeyson's full-sized avatar
🎯
Focusing

Jaeyson Anthony Y. ⚗️ jaeyson

🎯
Focusing
View GitHub Profile
@jaeyson
jaeyson / .vimrc
Last active December 14, 2020 02:12
ubuntu settings
" automatically leave insert mode after 'updatetime' milliseconds of inaction
" au CursorHoldI * stopinsert
" set 'updatetime' to 15 seconds when in insert mode
" au InsertEnter * let updaterestore=&updatetime | set updatetime=5000
" au InsertLeave * let &updatetime=updaterestore
" when you have error about dos line ending (clue here is ^M)
" most likely your file has line ending with dos
" to check the file type :set ff?
@jaeyson
jaeyson / basic-algo.md
Last active July 20, 2019 11:27
FCC JS Challenges. lately realized that all of my previous completed puzzles are gone. oh boy, time to move on.

Javascript Algorithms And Data Structures Certification (300 hours)

Basic Algorithm Scripting

Chunky Monkey

function chunkArrayInGroups(arr, size) {
  let divisor = Math.floor(arr.length/size);
  let lastElem = divisor*size;
@jaeyson
jaeyson / commit_msg_template.md
Last active August 12, 2021 06:44
commit message template for git

1. Create a template

# ----------------------------------------------------------
# Header - (type): Brief description
# ----------------------------------------------------------
#   * feat         A new feature
#   * fix          A bug fix
#   * docs         Changes to documentation only
#   * style        Style/format changes (whitespace, etc.)
<?php
namespace App;
use Illuminate\Support\Collection;
use Illuminate\Database\Eloquent\Builder;
class CursorPaginate
{
// (new CursorPaginate())->loadMacro(); //AppServiceProvider boot method
@jaeyson
jaeyson / diy-create-service-account.md
Created November 22, 2021 13:29
Roll-your-own gcp service account key

Roll-your-own gcp service account key

You can see the reason listed here -> source

TLDR; generate service account key file without transporting the private key.

1. Create service account

gcloud iam service-accounts create look-no-keys
-module(ring).
-export([start/0]).
% start/0 top function to run.
% c(ring).
% ring:start().
start() ->
% trace who (process) called the func (mod:func)
@jaeyson
jaeyson / test.exs
Created October 7, 2022 07:39
Submarine route command
data =
"""
forward 5
down 5
forward 8
up 3
down 8
forward 2
"""
defmodule SchemaChecker do
def find_field_discrepancies do
schema_modules()
|> Enum.map(fn mod ->
{mod.__schema__(:source), check_module(mod)}
end)
end
defp schema_modules do
{:ok, modules} = :application.get_key(:core, :modules)
<?php
ini_set('display_errors', 0);
include('includes/config.php');
include('includes/helpers/locale.php');
include('includes/helpers/integrations/zapier/triggers/functions.php');
include('includes/helpers/integrations/rules.php');
include('includes/helpers/subscription.php');
include('includes/helpers/EmailAddressValidator.php');
//--------------------------------------------------------------//
@jaeyson
jaeyson / zed_keybindings.json
Created June 14, 2024 06:26
Zed editor keybindings
[
{
"context": "Pane",
"bindings": {
"cmd-1": ["pane::ActivateItem", 0],
"cmd-2": ["pane::ActivateItem", 1],
"cmd-3": ["pane::ActivateItem", 2],
"cmd-4": ["pane::ActivateItem", 3],
"cmd-5": ["pane::ActivateItem", 4],
"cmd-6": ["pane::ActivateItem", 5],