Skip to content

Instantly share code, notes, and snippets.

View rodrisan's full-sized avatar
🏠
Working from home

Rodrigo S rodrisan

🏠
Working from home
  • 20:15 (UTC -06:00)
View GitHub Profile
@rodrisan
rodrisan / semantic-commit-messages.md
Created February 28, 2024 15:08 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rodrisan
rodrisan / save-code-coverage.php
Created October 20, 2023 18:39 — forked from derickr/save-code-coverage.php
save-code-coverage.php
<?php
require 'vendor/autoload.php';
use SebastianBergmann\CodeCoverage\Filter;
use SebastianBergmann\CodeCoverage\Driver\Selector;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Report\PHP as PhpReport;
$filter = new Filter;
$filter->includeDirectory( __DIR__ . '/html' );
@rodrisan
rodrisan / nvm-auto-run.md
Created May 25, 2023 23:20 — forked from tcrammond/nvm-auto-run.md
Automatically nvm use when entering directory

Calling nvm use automatically in a directory with a .nvmrc file

Put this into your $HOME/.zshrc to call nvm use automatically whenever you enter a directory that contains an .nvmrc file with a string telling nvm which node to use:

place this after nvm initialization!

@rodrisan
rodrisan / split.py
Created October 14, 2022 17:28 — forked from kelvintaywl/split.py
Python Script to split CSV files into smaller files based on number of lines
import csv
import sys
import os
# example usage: python split.py example.csv 200
# above command would split the `example.csv` into smaller CSV files of 200 rows each (with header included)
# if example.csv has 401 rows for instance, this creates 3 files in same directory:
# - `example_1.csv` (row 1 - 200)
# - `example_2.csv` (row 201 - 400)
# - `example_3.csv` (row 401)
@rodrisan
rodrisan / phpmd-ruleset.xml
Created August 12, 2022 16:31 — forked from slayerfat/phpmd-ruleset.xml
php mess detector ruleset for laravel and similar frameworks
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Laravel and similar phpmd ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
Inspired by https://github.com/phpmd/phpmd/issues/137
using http://phpmd.org/documentation/creating-a-ruleset.html
</description>

Docker Completion for Zsh (Official)

  • mkdir -p ~/.oh-my-zsh/plugins/docker/
  • curl -fLo ~/.oh-my-zsh/plugins/docker/_docker https://raw.githubusercontent.com/docker/cli/master/contrib/completion/zsh/_docker
  • Add docker to plugins section in ~/.zshrc
  • exec zsh
@rodrisan
rodrisan / docker-compose.sh
Created March 17, 2022 23:21 — forked from Gems/docker-compose.sh
A `docker-compose` wrapper for multiple configuration files with relative paths
#!/usr/bin/env bash
TMP_FILE=/tmp/docker-compose.$$.yaml
finish() {
rm ${TMP_FILE} ${TMP_FILE}.tmp 2>/dev/null
}
trap finish EXIT
@rodrisan
rodrisan / README.md
Created November 4, 2020 21:38 — forked from natterstefan/README.md
How to track content statistics for Facebook Instant Articles with Google Analytics

Track Facebook Instant Articles with Google Analytics

The *.html example assumes you have integrated the tracking code as an iframe in the instant articles feed.

<figure class="op-tracker">
    <iframe src="https://www.example.com/fia-google-analytics-tracking.html"></iframe>
</figure>
@rodrisan
rodrisan / README.md
Created October 29, 2020 01:52 — forked from antonydevanchi/README.md
Download all images from undraw.co/illustrations
@rodrisan
rodrisan / wp-config-debug.php
Created May 12, 2020 23:25 — forked from jrfnl/wp-config-debug.php
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*