Skip to content

Instantly share code, notes, and snippets.

View 3runoDesign's full-sized avatar
🏡
Stay well, Stay home

Bruno Fernando dos Santos Silva 3runoDesign

🏡
Stay well, Stay home
View GitHub Profile
@letanure
letanure / estados-cidades.json
Last active April 19, 2024 18:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active April 16, 2024 16:36
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@avataru
avataru / EloquentCheatSheet.md
Last active April 5, 2024 20:39
Eloquent relationships cheat sheet
@EdnilsonRobert
EdnilsonRobert / ssh.md
Created August 23, 2019 00:53
Múltiplas chaves SSH para GitHub e GitLab

Múltiplas chaves SSH para GitHub e GitLab

1. Gerar Chaves SSH

ssh-keygen -t rsa -C "user@email.com" -b 4096 -f ~/.ssh/id_rsa_github
ssh-keygen -t rsa -C "user@email.com" -b 4096 -f ~/.ssh/id_rsa_gitlab

2. Copiar chaves para GitHub e GitLab

@fdaciuk
fdaciuk / Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress.md
Last active March 8, 2024 20:52
Adicionar novo campo (custom field) a uma taxonomia no WordPress (Incluir esse código no functions.php)Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)

Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress

Incluir esse código no functions.php.

Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)

@jonblatho
jonblatho / PointInPolygon.swift
Last active November 13, 2023 06:31
Some Swift code to determine whether a point is inside a polygon.
/// Contains the coordinates of a point in a 2D Cartesian coordinate system.
public struct Point: Hashable {
/// The x-coordinate of the point.
public var x: Double
/// The y-coordinate of the point.
public var y: Double
}
extension Array where Element == Point {
/// Returns only the unique points in the array.
@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active November 8, 2023 21:03
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@wkw
wkw / WordPress On-Demand Custom Image Sizes
Created August 7, 2014 16:18
Add this to your WordPress functions.php if you are using many custom image sizes (add_image_size(...)) to prevent the creation of all the sizes upon image upload. This will only generate a custom size the first time it is requested.
/* ======================================================================================
//! -- On Demand Image Sizing --
Experimental code for generating custom image sizes on demand.
http://wordpress.stackexchange.com/a/124790
From the author...
"When an image is then requested in a particular size,
which is not yet generated, it will be created only that once."
====================================================================================== */
@alieslamifard
alieslamifard / withPrivateRoute.jsx
Last active May 31, 2023 20:10
Private route HOC for Next.js
import React from 'react';
import Router from 'next/router';
const login = '/login?redirected=true'; // Define your login route address.
/**
* Check user authentication and authorization
* It depends on you and your auth service provider.
* @returns {{auth: null}}
*/
@pd95
pd95 / AppIcons.command
Last active December 28, 2022 20:56
A ZSH command file to produce the various PNG files required for iOS and macOS app Icons using `sips` (scriptable image processing system) available on any macOS. The resulting PNGs in the "AppIcons" folder can then be dragged into Xcode's `Assets.xcassets` onto a placeholder for an AppIcon.
#!/bin/zsh
# Shell Script to create all relevant icons from an high resolution artwork
if [ "x$1" != "x" -a -f "$1" ] ; then
INPUT=$1
else
INPUT="Artwork.png"
fi
if [ ! -f "$INPUT" ]; then