Skip to content

Instantly share code, notes, and snippets.

View Yohn's full-sized avatar
🔥
Playing with Fire

JWB Yohn

🔥
Playing with Fire
View GitHub Profile
@Yohn
Yohn / function.generateRandomString.php
Created January 9, 2023 05:01
Simple generate random string function in PHP with max length option and easy to change characters.
<?php
function generateRandomString($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
}
  • Codacy
  • Coveralls
  • Travis
  • Lean Board
  • Starhub
  • Code Dog Auto Merge
  • Greenkeeper
  • Dependabot preview
  • Hound
  • Imgbot
@ghuntley
ghuntley / gitpod.yml reference
Last active September 24, 2022 21:09
Iterating on a reference Gitpod.yml that serves as a verbose 'documentation as code' which is intended to explain possibilities and how to configure them without folks needing to open a browser. Leave feedback on https://gist.github.com/ghuntley/1914fd5d15aec638d6dbb8d32d00f1e5 if you got any.
## Learn more about this file at 'https://www.gitpod.io/docs/references/gitpod-yml'
##
## This '.gitpod.yml' file when placed at the root of a project instructs
## Gitpod how to prepare & build the project, start development environments
## and configure continuous prebuilds. Prebuilds when enabled builds a project
## like a CI server so you can start coding right away - no more waiting for
## dependencies to download and builds to finish when reviewing pull-requests
## or hacking on something new.
##
## With Gitpod you can develop software from any device (even iPads) via
@Z3d0X
Z3d0X / FilamentQuickStart.php
Created April 8, 2022 19:34
Quickly install and configure filament in a new laravel project
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class FilamentQuickStart extends Command
{
protected $signature = 'filament:quickstart';

🌆 Banco de imagens gratuitas

  • Burst - Plataforma de imagens do serviço de ecommerce Shopify
  • DrawKIT - Ilustrações para qualquer um usar
  • FlatIcon - Banco de ícones vetoriais
  • Flickr - Rede social de fotógrafos
  • FreeImages - Banco de imagens gratuitas
  • FreePik Stories - Banco de ilustrações gratuitas
  • Humaaans - Ilustrações de humanóides
  • Icons8 - Ícones em diversos estilos
  • Imgur - Plataforma com milhões de imagens
// This app initially started from Flavio Copes analytics example
// but diverged quite a bit to generate images as well as track views
// https://flaviocopes.com/count-visits-static-site/
const express = require('express')
const app = express()
// no db - so global var to keep track of count
let counter = 0
@abelcheung
abelcheung / firefox-viewsource-customize.md
Last active May 28, 2023 18:18
Customizing Firefox view-source style -- Solarized Dark theme with wallpaper

Customizing Firefox view-source style

TL;DR

  1. Open (or create) chrome/userContent.css under your Firefox profile folder
  2. Append attached CSS content and save file
  3. Toggle toolkit.legacyUserProfileCustomizations.stylesheets in Firefox about:config
  4. Restart Firefox

firefox view-source style customization

@asleepysamurai
asleepysamurai / bootstrap.tooltip.js
Created October 29, 2012 07:32
Bootstrap tooltip plugin - modified to be rendered within the viewport and not runoff. Added a placement option 'auto' which determines the correct placement depending on viewport size. If suitable space is not available on any side of the element, then t
/* ===========================================================
* bootstrap-tooltip.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame
* ===========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@hakre
hakre / iteration-and-recursive-iteration.php
Created September 2, 2012 14:26
Iteration and Recursive Iteration Examples Code
<?php
/*
* Iteration and Recursive Iteration Examples Code
*
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php
* @author hakre <http://hakre.wordpress.com>
*/
### To have these examples to work, a directory with subdirectories is needed,
### I named mine "tree":
@Zodiac1978
Zodiac1978 / .htaccess
Last active March 15, 2024 08:29
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/