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
@bradtraversy
bradtraversy / pdo_db.php
Created February 21, 2018 12:56
PDO Class
<?php
/*
* PDO DATABASE CLASS
* Connects Database Using PDO
* Creates Prepeared Statements
* Binds params to values
* Returns rows and results
*/
class Database {
private $host = DB_HOST;

How to install Laravel globally in Ubuntu

===================================================================

Open your terminal using Ctrl+Alt+T and type the following commands

Step 1: Install Laravel

composer global require "laravel/installer"
@seanh
seanh / html_tags_you_can_use_on_github.md
Last active April 30, 2025 20:56
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

@MuhammadFaizanKhan
MuhammadFaizanKhan / PDOFunctionsDemo.php
Last active April 30, 2023 22:35
Insert, Update, Delete and Select with PHP, PDO and MySQL
<?php
/**
* Created by PhpStorm. * User: Faizan Khan * Date: 1/2/2018 * Time: 10:51 AM
*/
/*Script Motive: The purpose of the file is to present different PDO Functions for DML and DDL operations
Sample Table
Table Name: UserTbl
Columns: Id, UserName, Email, RecordAddDate
*/
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 1, 2025 13:21
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@umidjons
umidjons / unit-testing-model-using-dbunit-extension.md
Created December 11, 2016 08:01
Unit testing model using DBUnit PHPUnit extension

Unit testing model using DBUnit PHPUnit extension

I assume, that you already have phpunit installed and added into PATH. Create guestbook database in mysql. Create guestbook table in that database.

Create model to test

File src\Guestbook.php

<?php
@ftonato
ftonato / database.class.php
Last active November 29, 2024 15:08
PDO Connection Class using Singleton
<?php
/**
* PDO Singleton Class v.1.0
*
* @author Ademílson F. Tonato
* @link https://twitter.com/ftonato
*
*/
class DB {
@memeplex
memeplex / extra.js
Created August 2, 2016 20:41
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')
@sid24rane
sid24rane / websqlcrud.js
Created May 31, 2016 09:00
Web SQL Database Basic CRUD ( Create,Read,Update,Delete ) operation implementation!
function createDb() {
var db_name = 'jabber';
var db_version = '1.0';
var db_describe = 'Bro,its jabber';
var db_size = 2048;
var db = openDatabase(db_name, db_version, db_describe, db_size, function(db) {
console.log(db);
console.log("Database opened Successfully! Or created for the first time !");
createTable(db);
});
@knoonrx
knoonrx / Extenso.php
Last active December 28, 2022 09:33
Converte números e exibe por extenso em php Fonte: http://www.dirceuresende.com/blog/escrevendo-numero-por-extenso-no-php/
<?php
/**
* Created by PhpStorm.
* User: Rodrigo Brandão
* Date: 21/03/2016
* Time: 11:07
*/
class Extenso
{
public static function removerFormatacaoNumero( $strNumero )