Skip to content

Instantly share code, notes, and snippets.

View jhonnymoreira's full-sized avatar

Jhonny Moreira jhonnymoreira

View GitHub Profile

Variables

const shade = 100;
type Shade = 100;

Functions

Roadmap de estudos de SQL

Aviso: Muitas vezes detalhes de várias operações podem variar de banco para banco. Em questões onde fiquei em dúvida, este documento segue o funcionamento do PostgreSQL, pois é o banco que conheço melhor.

Pré-requisito: Álgebra Relacional básica

Antes de começar a escrever SQL, você precisa entender o modelo de como um banco de dados relacional funciona. Não precisa se aprofundar muito, mas você precisa entender como que dados e relacionamentos entre eles são representados. (Nota importante: Relacionamento e relação não são a

@MrChocolatine
MrChocolatine / TS - More precise return type method Date#toISOString.d.ts
Last active July 12, 2024 00:28
TypeScript – How to accurately type dates in ISO 8601 format
// In TS, interfaces are "open" and can be extended
interface Date {
/**
* Give a more precise return type to the method `toISOString()`:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
toISOString(): TDateISO;
}
type TYear = `${number}${number}${number}${number}`;
@klzns
klzns / picture-in-picture.js
Last active July 2, 2018 15:11
Adicione esse script para abrir a transmissão da copa em picture in picture no Safari.
(function () {
var video = document.querySelector('video:not([title="Advertisement"])')
if (!video.webkitSupportsPresentationMode || typeof video.webkitSetPresentationMode !== 'function') {
console.error('Esse código só funciona no Safari!')
return
}
var scoreX = document.querySelector('.placar__equipes')
var button = document.createElement('button')
@Qix-
Qix- / sha256.sh
Last active July 10, 2023 10:00
SHA256 in (mostly) pure Bash script
#!/usr/bin/env bash
# Released into the Public Domain.
#
# Original implementation in C by Brad Conte (brad@bradconte.com) <https://github.com/B-Con/crypto-algorithms>
# Ported to Bash (lol) by Josh Junon (josh@junon.me) <https://github.com/qix->
#
# Yes, it's absolutely as slow as it looks.
#
# The only external dependency it has is on a utility called `od`,
@thunklife
thunklife / cfp.md
Last active September 2, 2017 17:17

Title:

Types For Frontend Developers

Description:

It's hard to bring up static types in JavaScript without starting a debate. The benefits of using static types are real, and so are the tradeoffs. As with so many things in software, the key to figuring out if the benefits outweigh the costs for you and your team. At Reflexion Health, we recently looked at introducing static types; I'd like to share some of the lessons we learned, and shed some light on how static types can help your team.

Topics:

Frontend Tools (maybe Future JS?)

Subtopics:

@ruebenramirez
ruebenramirez / setup-franz-ubuntu.sh
Created September 7, 2016 17:55
setup franz on ubuntu
#!/bin/bash
sudo rm -fr /opt/franz
sudo rm -fr /usr/share/applications/franz.desktop
# create installation dir
sudo mkdir -p /opt/franz
#install franz
var autocompletes = ['name', 'honorific-prefix', 'given-name',
'additional-name', 'family-name', 'honorific-suffix',
'nickname', 'username', 'new-password',
'current-password', 'organization-title', 'organization',
'street-address', 'address-line1', 'address-line2',
'address-line3', 'address-level4', 'address-level3',
'address-level2', 'address-level1', 'country',
'country-name', 'postal-code', 'cc-name', 'cc-given-name',
'cc-additional-name', 'cc-family-name', 'cc-exp',
'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type',
@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created January 19, 2016 07:42
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links