Skip to content

Instantly share code, notes, and snippets.

Cheat Sheet para o teste de EW

Setup do projeto

Criar servidor express.js

Para criar um servidor express.js para servir de API:

npx express-generator --no-view nome-do-projeto
@JaysonChiang
JaysonChiang / api.ts
Last active May 14, 2024 12:20
Example of Axios with TypeScript
import axios, { AxiosError, AxiosResponse } from 'axios';
import token from './somewhere';
interface Todo {
id: string;
title: string;
}
interface User {
id: string;
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@bmaupin
bmaupin / free-backend-hosting.md
Last active May 14, 2024 12:18
Free backend hosting
@Yatoom
Yatoom / setup.md
Last active May 14, 2024 12:17
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@fians
fians / optimize.php
Created January 3, 2018 10:24
Optimize Image in PHP using Imagick according Google Pagespeed Recommendation
/**
* Optimize image image
*
* https://developers.google.com/speed/docs/insights/OptimizeImages
* -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB
*
* @access public
* @param string $filePath Path of the file
* @return string Raw image result from the process
*/
@jpierson
jpierson / min-max-dates.md
Last active May 14, 2024 12:16
A summary of min/max date values used by various systems

Summary of Min/Max date values for various systems

System/Type Min Max Notes
.NET (DateTime) 1/1/0001 12:00:00 AM 12/31/9999 11:59:59 PM
T-SQL (datetime) January 1, 1753 December 31, 9999 Default value is 1900-01-01 00:00:00
Oracle (DATE) 0001-01-01 9999-12-31
Oracle (TIME) 00:00:00 24:00:00
Oracle (TIMESTAMP) 0001-01-01-00.00.00.000000 9999-12-31-23.59.59.999999
ISO 8601 1583-01-19T0:00:00Z 9999-12-31T023:59:59Z
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 14, 2024 12:13
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rsms
rsms / macos-distribution.md
Last active May 14, 2024 12:12
macOS distribution — code signing, notarization, quarantine, distribution vehicles