Skip to content

Instantly share code, notes, and snippets.

View ideaguy3d's full-sized avatar
🤗
... learn, build, repeat.

Julius Hernandez Alvarado ideaguy3d

🤗
... learn, build, repeat.
View GitHub Profile
@ideaguy3d
ideaguy3d / log.py
Created June 30, 2021 09:24 — forked from nguyenkims/log.py
Basic example on how setup a Python logger
import logging
import sys
from logging.handlers import TimedRotatingFileHandler
FORMATTER = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
LOG_FILE = "my_app.log"
def get_console_handler():
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setFormatter(FORMATTER)

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@ideaguy3d
ideaguy3d / _ide_helper.php
Created July 8, 2020 14:24 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@ideaguy3d
ideaguy3d / function.php
Created July 31, 2018 23:24 — forked from hlashbrooke/function.php
PHP: Loop through each character in a string
<?php
$str = "String to loop through"
$strlen = strlen( $str );
for( $i = 0; $i <= $strlen; $i++ ) {
$char = substr( $str, $i, 1 );
// $char contains the current character, so do your processing here
}
?>
@ideaguy3d
ideaguy3d / stopwatch.php
Created April 11, 2018 19:35 — forked from chuckreynolds/stopwatch.php
Simple "StopWatch" class to measure PHP execution time. The class can handle multiple separate timers at the same time
<?php
class StopWatch {
/**
* @var $startTimes array The start times of the StopWatches
*/
private static $startTimes = array();
/**
* Start the timer
*
@ideaguy3d
ideaguy3d / xampp_php7_xdebug.md
Created February 15, 2018 19:16 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup