Skip to content

Instantly share code, notes, and snippets.

View alejandrofloresm's full-sized avatar

Alejandro Flores alejandrofloresm

View GitHub Profile
@alejandrofloresm
alejandrofloresm / RemoveCarriage.vb
Created September 14, 2017 05:20
Remove new line and change it for a <br>
'taken from: https://www.extendoffice.com/documents/excel/902-excel-remove-line-breaks.html
Sub RemoveCarriage()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
Rng.Value = Replace(Rng.Value, Chr(13), "<br>")
@alejandrofloresm
alejandrofloresm / .editorconfig
Created October 3, 2017 06:01
An .editorconfig proposal for Laravel projects
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
@alejandrofloresm
alejandrofloresm / script.sh
Created November 21, 2017 00:22
Remove all the branches except master and the current one
# Remove all the branches except master and the current one
# Resource: https://coderwall.com/p/x3jmig/remove-all-your-local-git-branches-but-keep-master
git branch | egrep -v "(master|\*)" | xargs git branch -D
@alejandrofloresm
alejandrofloresm / gist:3f5475b6900f4b22c277de8ed4efe781
Created December 10, 2017 23:35
Connect using the socket of MySQL ampps
ln -s /Applications/AMPPS/var/mysql.sock /tmp/mysql.sock
@alejandrofloresm
alejandrofloresm / margin-padding-gen.scss
Created December 23, 2017 07:49
Generate margin and padding options
/**
* Generates margin and padding classes:
* usage:
* @include gen-mar-pad(10, px);
* generates:
* .margin-top-10 {
* margin-top: 10px;
* }
*
* .padding-top-10 {
@alejandrofloresm
alejandrofloresm / AppServiceProvider.php
Created January 31, 2019 17:47
Laravel AppServiceProvider.php for AMPPS
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
/**
using UnityEngine;
using System.Collections;
public class MoveToTargets : MonoBehaviour {
// Lugar a donde vamos
public Transform[] Targets;
public int _targetIndex = 0;
// Velocidad que tenemos
public float Speed = 1;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class GameManager : MonoBehaviour
{
public Transform Player;
// Start is called before the first frame update
void Start()
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Zoológicos</title>
<meta name="description" content="">
<meta name="author" content="">
</head>
<body>
<h1>Zoológicos</h1>
@alejandrofloresm
alejandrofloresm / backup_create_user.sql
Last active November 26, 2020 05:04
Create a user for backing up your database.sql
CREATE USER '{{ BACKUP_USER_NAME }}'@'localhost' IDENTIFIED BY '{{ BACKUP_USER_PASSWORD }}';
GRANT SELECT, SHOW VIEW, RELOAD, REPLICATION CLIENT, EVENT, TRIGGER ON {{ BACKUP_DATABASE_NAME }}.* TO '{{ BACKUP_USER_NAME }}'@'localhost';
FLUSH PRIVILEGES;
-- CREATE DATABASE
CREATE DATABASE {{DATABASE_NAME}} CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER '{{DATABASE_USER}}'@'{{DATABASE_HOST}}' IDENTIFIED BY '{{BACKUP_USER_PASSWORD}}';
GRANT ALL PRIVILEGES ON {{DATABASE_NAME}}.* TO '{{DATABASE_USER}}'@'{{DATABASE_HOST}}' WITH GRANT OPTION;