Skip to content

Instantly share code, notes, and snippets.

View dantehemerson's full-sized avatar
🍊
Leveling up!!!

Dante Calderon dantehemerson

🍊
Leveling up!!!
View GitHub Profile
@dantehemerson
dantehemerson / challenge-solution.js
Last active February 23, 2024 02:22
Solution by Dante Calderon
// Complexity: O(n log n)
// Explanation: Sort the string and then check if a character is repeated
// by comparing if 2 consecutive characters are the same.
//
// To avoid a new data structure I implemented the well known quick-sort algorithm
// to sort the string so I avoid the split and join which creates an array (typically used to sort strings).
//
function isUnique(str) {
const sortedString = quickSortString(str); // O (n log n)
@dantehemerson
dantehemerson / remap_app_switcher_vim_like_keys.json
Created April 12, 2023 06:37
Remap app switcher to Vim-like keys
{
"title": "Remap app switcher to Vim-like keys",
"rules": [
{
"description": "Remap app switcher to Vim-like keys",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",

Keybase proof

I hereby claim:

  • I am dantehemerson on github.

  • I am dantehemerson (https://keybase.io/dantehemerson) on keybase.

  • I have a public key ASAqYmAbyHNHUDMtVPOqiPJftle74akWVK1QxTOdlZGczwo

export const regExpEscape = (s: any) => {
return String(s)
.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1')
.replace(/\x08/g, '\\x08')
}
@dantehemerson
dantehemerson / 1.md
Created June 2, 2020 08:10 — forked from swyxio/1.md
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos

@dantehemerson
dantehemerson / nodemailer_ses
Created March 11, 2020 16:25
Send mail to many users
import * as clone from 'clone'
import { Injectable } from '@nestjs/common'
import { ConfigService } from '@rate-manager/config'
import { createTransport, SendMailOptions, Transporter } from 'nodemailer'
import { of, from } from 'rxjs'
import { tap, concatMap } from 'rxjs/operators'
const inlineBase64 = require('nodemailer-plugin-inline-base64')
@Injectable()
@dantehemerson
dantehemerson / .gitconfig
Created January 30, 2020 19:27 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@dantehemerson
dantehemerson / History|-11f8da0e|entries.json
Last active July 21, 2022 00:39
PRINCIPAL SETTINGS PARA MI TRABAJO
{"version":1,"resource":"file:///home/dantehemerson/Documents/repos/hangmant-api/src/modules/messages/messages.resolver.ts","entries":[{"id":"Dgrp.ts","timestamp":1657981742568},{"id":"tyD5.ts","timestamp":1658082118784},{"id":"qoDS.ts","timestamp":1658082136380},{"id":"PSFZ.ts","timestamp":1658082206270}]}
@dantehemerson
dantehemerson / characterset.sql
Created February 12, 2019 17:06
Character Set Mysql
mysql> SHOW CHARACTER SET;
+----------+-----------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+----------+-----------------------------+---------------------+--------+
| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |
| dec8 | DEC West European | dec8_swedish_ci | 1 |
| cp850 | DOS West European | cp850_general_ci | 1 |
| hp8 | HP West European | hp8_english_ci | 1 |
| koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 |
| latin1 | cp1252 West European | latin1_swedish_ci | 1 |