Skip to content

Instantly share code, notes, and snippets.

View felds's full-sized avatar
:shipit:

Luiz “Felds” Liscia felds

:shipit:
View GitHub Profile
@felds
felds / index.html
Created March 17, 2024 22:51
TODO rapidinho com a M
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<meta name="color-scheme" content="dark light">
<style>
* {
font-size: 32px;
@felds
felds / serializing.ts
Created October 6, 2023 23:13
Serializing/reviving objects in TS
class Point {
constructor(
public x: number,
public y: number,
) {}
serialize(): any {
return {__type: this.constructor.name, x: this.x, y: this.y}
}
toString() {
return `I'm a point: ${this.x}, ${this.y}`
@felds
felds / palette.scss
Created August 20, 2023 20:52
Sass Palette generator
@use "sass:color";
@use "sass:list";
@use "sass:math";
@use "sass:meta";
// Create a list of numbers
@function range($from, $to, $step: 1) {
// validation
@if meta.type-of($from) != "number" {
@error "$from must be a number.";
type SuspendStatus = "pending" | "success" | "error";
export function suspend<T>(promise: Promise<T>) {
let result: T;
let error: Error;
let status: SuspendStatus = "pending";
let suspender = promise.then(
(r) => {
status = "success";
result = r;
@felds
felds / form.html
Last active September 23, 2021 20:14
Remove validation and prompt when exiting unsaved form
<script>
const forms = Array.from(document.querySelectorAll("form"))
// disable browser validation
forms.forEach(el => el.noValidate = true)
// add unsaved data prompt
let unsaved = false;
window.addEventListener("beforeunload", (e) => {
if (unsaved) {
@felds
felds / cloudbuild.sample.yaml
Last active April 28, 2021 04:54
Cloud Build to GCE sample
# IMPORTANT:
# Dont forget to to replace the INSTANCE_NAME for the name
# of the instance we created on step 2
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '-t'
@felds
felds / wp-config.php
Created July 12, 2020 05:16
Common settings for wp-config
<?php
/**
* common settings for wp-config
*/
// dont try to connect via ftp for updates
define( 'FS_METHOD', 'direct' );
// force urls
@felds
felds / README.md
Last active May 6, 2019 20:08
Instalação novo server WP (ubuntu 18.4)
  • Pra começar, atualize o sistema:

    sudo apt update
    sudo apt upgrade -y
  • Intale o MariaDB:

    sudo apt install -y mariadb-server
    sudo mysql_secure_installation
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
@felds
felds / sharing-buckets.md
Last active March 15, 2018 03:13 — forked from anonymous/sharing-buckets.md
Como compartilhar bucket e publicar conteúdo no bucket compartilhado

Como compartilhar bucket e publicar conteúdo no bucket compartilhado

1. Compartilhando o bucket

No bucket a ser compartilhado, o dono do bucket deve inserir a seguinte policy:

{