Skip to content

Instantly share code, notes, and snippets.

View hicarorios's full-sized avatar

Hicaro Alfonso Rios hicarorios

  • Campo Grande MS BR
View GitHub Profile
@hicarorios
hicarorios / multiple-ssh-keys-git.adoc
Created December 13, 2023 18:25 — forked from alejandro-martin/multiple-ssh-keys-git.adoc
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@hicarorios
hicarorios / built-in-server-xdebug.txt
Created December 20, 2018 19:55
Configurar o servidor embutido do PHP com xdebug no PHPStorm
Para acessar a configuração no PHPStorm: ctrl + shift + A -> type: run debug -> Add Configuration -> + -> PHP Built-in Web Server
se você tem um script server.php (para simular o mod_rewrite do apache*, roteador inicial) você deve marcar a opção "Use route script"
em "interpreter options" coloque: -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1
o resultado será: php -S localhost:8000 -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1
{
  "rulesDirectory": [
    "node_modules/codelyzer"
  ],
  "rules": {
    "arrow-return-shorthand": true,
    "callable-types": true,
    "class-name": true,
--  "comment-format": [
@hicarorios
hicarorios / homestead_sqlsrv_driver_installer.sh
Created May 9, 2018 13:10 — forked from andysnell/homestead_sqlsrv_driver_installer.sh
SQL Server Driver Installer for Laravel Homestead
#!/bin/bash
# SQL Server Driver Installer for Laravel Homestead
#
# This script downloads, compiles, and installs the PHP 7 extension
# files for both the native sqlsrv and the PDO pdo_sqlsrv drivers.
# Get the Microsoft Driver Source Code from Github
cd ~
git clone https://github.com/Microsoft/msphpsql.git
cd msphpsql
@hicarorios
hicarorios / gist:dd4b2c44bd8210eddd6098361a50952e
Created February 15, 2018 18:19 — forked from alekpopovic/gist:ce3635c7e29596e6f65154b1785e5ef9
Installing Laravel 5.2 on Ubuntu 16.04 and Apache2
Installing Laravel 5.2 on Ubuntu 16.04 and Apache2
This post will document how I installed Laravel 5.2, on Apache2 on an Ubuntu 16.04 server. Will will also install MySQL, as we will need a database, and PHP which is required by Laravel. This will be the starting point of most of my posts, so if you’re following along from scratch…this is “scratch!”
First thing you need, of course, is the Ubuntu 16.04 server, with an SSH connection. Follow these excellent instructions and get yourself sorted out with one. Make sure you also give the server a static IP address (step 8., in the linked instructions). Come back when you’re done.
Welcome back! Lets get started.
@hicarorios
hicarorios / render_view_as_variable.php
Created April 19, 2016 18:31 — forked from rakeshtembhurne/render_view_as_variable.php
CakePHP: Render view in a variable inside controlller
<?php
$view = new View($this, false);
$view->set(compact('some', 'vars'));
$html = $view->render('view_name');
@hicarorios
hicarorios / S2 S2
Created December 7, 2015 20:08
S2 S2
(_|_)(_|_)(_|_)
(_|_)(_|_)(_|_)(_|_)
(_|_) (_|_) (_|_)
(_|_)(_|_)(_|_)(_|_)(_|_)
(_|_)(_|_)(_|_)(_|_)
(_|_)(_|_)(_|_)
(_|_)(_|_)
(_|_)
@hicarorios
hicarorios / gist:c2cf9cc604d4c7950972
Last active August 29, 2015 14:02
Adiciona php cli do zend server 6.1 no PATH do ubuntu 10.14
cat >> $HOME/.bashrc <<EOF
export PATH=$PATH:/usr/local/zend/bin:/usr/local/zend/sbin
EOF
reboot
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
# httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@hicarorios
hicarorios / integerValidator
Created September 9, 2013 17:05
Permite apenas números em determinado campo. Utiliza jQuery.
$(document).ready(function() {
$("#txtboxToFilter").keydown(function(event) {
// Allow: backspace, delete, tab, escape, and enter
if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
// Allow: Ctrl+A
(event.keyCode == 65 && event.ctrlKey === true) ||
// Allow: home, end, left, right
(event.keyCode >= 35 && event.keyCode <= 39)) {
// let it happen, don't do anything
return;