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
@3runoDesign
3runoDesign / AppDelegate.m
Created January 7, 2022 02:28
Print Font Names on IOS
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
@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
@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

<?php
namespace App\Lib;
use Utils;
class BulmaWalker extends \Walker_Nav_Menu
{
private $cpt; // CPT, is current post a custom post type
private $archive; // Stores the archive page for current URL
public function __construct()
@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.
@lucasprogamer
lucasprogamer / main.js
Created May 21, 2018 20:03
CF7 Bulma Ajax-loader icon
/**
* when cf7 ajax-loader
* @param {[type]} form [description]
* @return {[type]} [description]
*/
wpcf7.submit = function( form ) {
if ( typeof window.FormData !== 'function' ) {
return;
}
@avataru
avataru / EloquentCheatSheet.md
Last active April 5, 2024 20:39
Eloquent relationships cheat sheet
@lucasprogamer
lucasprogamer / .htacess
Last active November 25, 2022 23:28
Add after # END WordPress.
#Força a utilizar Cache-Control e Expires header
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Html
@CodeVachon
CodeVachon / gulpfile.babel.js
Last active November 25, 2017 16:44
React Setup with Babel, Gulp, and Browserify
import gulp from 'gulp';
import browserify from 'browserify';
import source from 'vinyl-source-stream';
import buffer from 'vinyl-buffer';
import eslint from 'gulp-eslint';
import exorcist from 'exorcist';
import browserSync from 'browser-sync';
import watchify from 'watchify';
import babelify from 'babelify';
import uglify from 'gulp-uglify';