Skip to content

Instantly share code, notes, and snippets.

View ribafs's full-sized avatar
❤️
Estudando e Trabalhando

Ribamar FS ribafs

❤️
Estudando e Trabalhando
View GitHub Profile
@ribafs
ribafs / singularize.php
Last active June 1, 2023 22:50 — forked from peter-mcconnell/singularize.php
PHP singularize
<?php
/**
* Singularize a string.
* Converts a word to english singular form.
*
* Usage example:
* {singularize "people"} # person
*/
function singularize ($params)
{
@ribafs
ribafs / app.js
Created November 21, 2022 17:20 — forked from prof3ssorSt3v3/app.js
IndexedDB part 4 - add, put, and delete
import { uid } from './uid.js';
console.log(uid());
//nothing else to import because we are using the built in methods
//https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase
const IDB = (function init() {
let db = null;
let objectStore = null;
let DBOpenReq = indexedDB.open('WhiskeyDB', 6);
@ribafs
ribafs / README.md
Created November 15, 2022 17:05 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@ribafs
ribafs / markdown-details-collapsible.md
Created November 12, 2022 16:16 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

How to

<details>
  <summary>Click me</summary>
  
  ### Heading
  1. Foo
  2. Bar
     * Baz
 * Qux
@ribafs
ribafs / ErrorReporting.php
Created September 26, 2022 11:33 — forked from mevdschee/ErrorReporting.php
PHP error reporting class
<?php
class ErrorReporting
{
public static $errorMessage = 'Oops! Something went wrong.';
private static $cwd;
private static $debug;
/**
@ribafs
ribafs / Dumper.php
Created September 26, 2022 11:26 — forked from nicolas-grekas/Dumper.php
Advanced error handling in PHP
<?php /****************** vi: set fenc=utf-8 ts=4 sw=4 et: *****************
*
* Copyright : (C) 2011 Nicolas Grekas. All rights reserved.
* Email : p@tchwork.org
* License : http://www.gnu.org/licenses/lgpl.txt GNU/LGPL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@ribafs
ribafs / php-cli-colors.php
Created September 3, 2022 17:34 — forked from jveldboom/php-cli-colors.php
PHP CLI Colors - PHP Class Command Line Colors (bash)
<?php
// from http://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/
class Colors {
private $foreground_colors = array();
private $background_colors = array();
public function __construct() {
// Set up shell colors
$this->foreground_colors['black'] = '0;30';
$this->foreground_colors['dark_gray'] = '1;30';
@ribafs
ribafs / extra.js
Created August 24, 2022 11:04 — forked from memeplex/extra.js
Mkdocs bootswatch tweaks
// Hide sidebar with less than 2 entries.
var sidebar = $('.bs-sidebar')
var entries = sidebar.children().first()
if (entries.children().length <= 1)
sidebar.css('display', 'none')
else {
entries.children(':not(.main)').css('text-indent', '10px')
}
$('h1').css('font-weight', 'bold')
@ribafs
ribafs / html_tags_you_can_use_on_github.md
Created August 5, 2022 13:03 — forked from seanh/html_tags_you_can_use_on_github.md
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use File;
class MakeViewCommand extends Command
{
/**