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 / .passwd
Created June 29, 2017 15:30
Protecting vhost
user:pass
@felds
felds / get_related_posts.php
Last active February 11, 2018 19:53
Simple and straightforward function to get the related posts by tags in wordpress
@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:

{
# 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 / 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
@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 / 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 / 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) {
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 / 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.";