Skip to content

Instantly share code, notes, and snippets.

View AyozeVera's full-sized avatar

Ayoze Vera Arbelo AyozeVera

View GitHub Profile
@AyozeVera
AyozeVera / settings.json
Created November 8, 2021 10:02
VSCode settings
{
"yaml.schemas": {
"file:///Users/macbookpro/.vscode/extensions/atlassian.atlascode-2.9.1/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"
},
"atlascode.jira.jqlList": [
{
"id": "895d1640-8fc1-447f-9239-5f2987daafaf",
"enabled": true,
"name": "My 2coders Issues",
"query": "assignee = currentUser() AND resolution = Unresolved ORDER BY lastViewed DESC",
vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function ($binding) {
return is_numeric($binding) ? $binding : "{$binding}";
})->toArray())
<?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>

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

@AyozeVera
AyozeVera / CustomNodeFactory.js
Last active October 24, 2018 16:09
storm-react-diagrams
import { DiagramEngine, NodeModel, AbstractNodeFactory } from "storm-react-diagrams";
import { CustomNodeWidget, CustomNodeModel } from "../../components";
import * as React from "react";
export class CustomNodeFactory extends AbstractNodeFactory {
constructor() {
super("custom");
}
generateReactWidget(diagramEngine, node) {
@AyozeVera
AyozeVera / Cors.php
Created July 2, 2018 13:51
Laravel Cors Middleware configuration
<?php
namespace App\Http\Middleware;
use Closure;
class Cors
{
/**
* Handle an incoming request.
@AyozeVera
AyozeVera / lightmetter.ino
Created April 29, 2018 19:40
Arduino LightMetter & Relay
/*
Advanced BH1750 library usage example
This example has some comments about advanced usage features.
Connection:
VCC -> 3V3 or 5V
GND -> GND
@AyozeVera
AyozeVera / gh-pages-deploy.md
Created April 26, 2018 22:32 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@AyozeVera
AyozeVera / gh-pages-deploy.md
Created April 26, 2018 22:32 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

#!/usr/bin/env bash
# check if running as sudo
if [[ $UID == 0 ]]; then
echo "LOG => Please don´t run this script as sudo, it will ask for your password when required"
exit 1
fi
# packages