Skip to content

Instantly share code, notes, and snippets.

View jatubio's full-sized avatar

Juan Antonio Tubio jatubio

View GitHub Profile
@jatubio
jatubio / WaitForKey.ps1
Last active August 1, 2018 23:06
Show "Press any key to continue ..." and Wait until a key is pressed #powershell
Function WaitForKey
{
<#
.Synopsis
Show "Press any key to continue ...." and Wait until a key is pressed.
.Description
Can show a text before waiting.
.Notes
@jatubio
jatubio / ReplaceIniValue_Sample2.ps1
Last active March 14, 2016 11:04
PowerShell. Ini Files. Replacing a value in a key inside a section sample 2
# Ini files
# Replacing a value in a key inside a section sample
#
# RegEx101 Test (https://regex101.com/r/uC0cC3/1)
#
# http://stackoverflow.com/questions/29688299/powershell-and-regex-how-to-replace-a-ini-name-value-pair-inside-a-named-sectio/29688435#29688435
# Ini files
# Replacing a value in a key inside a section sample
#
@jatubio
jatubio / ReplaceIniValue_Sample1.ps1
Last active March 13, 2023 15:33
PowerShell. Ini Files. Replacing a value in a key inside a section sample 1
# Ini files
# Replacing a value in a key inside a section sample
#
# http://stackoverflow.com/questions/29688299/powershell-and-regex-how-to-replace-a-ini-name-value-pair-inside-a-named-sectio/29688435#29688435
#
$Path="c:\temp\test.ini"
@"
# This line have a white line after and before
@jatubio
jatubio / ReplaceIniValue_Sample3.ps1
Created April 17, 2015 11:16
PowerShell. Ini Files. Replacing a value in a key inside a section sample 3.
# Ini files
# Replacing a value in a key inside a section sample
#
# Calling Windows API function WritePrivateProfileString
# And using some C# code
#
# http://stackoverflow.com/questions/29688299/powershell-and-regex-how-to-replace-a-ini-name-value-pair-inside-a-named-sectio/29688435#29688435
$source = @"
<!--//
Kachun
Copyright (c) 2008 Fabio Zendhi Nagao <http://zend.lojcomm.com.br/>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
@jatubio
jatubio / web.config
Created April 29, 2015 03:49
IIS web.config file for Laravel 5
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Quitar los slash '/' del final de la ruta -->
<rule name="RewriteRequestsToPublic">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
</conditions>
@jatubio
jatubio / installcomposer.bat
Last active November 16, 2022 03:43
Install composer as portable on Windows and increases Timeout
@ECHO OFF
REM Installs Composer as portable and setup home folder as composer global config folder and local folder as internal cache
REM v.2.0 - 01/05/2015
REM jatubio@gmail.com
REM Set Home folder as Composer Global Configuration Folder
SET COMPOSER_HOME=%~dp0Home
if not exist %COMPOSER_HOME% md "%COMPOSER_HOME%"
php -r "readfile('https://getcomposer.org/installer');" | php
@jatubio
jatubio / composer.json
Created May 2, 2015 17:29
Laravel 5.1 composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.1.*"
},
"require-dev": {
<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="20" columns="98" buffer_rows="500" buffer_columns="0" init_dir="C:\Users\Kevin\Desktop" start_hidden="0" save_size="1" shell="C:\Program Files (x86)\Git\bin\sh.exe --login -i">
<colors>
<color id="0" r="0" g="43" b="54"/>
<color id="1" r="38" g="139" b="210"/>
<color id="2" r="133" g="153" b="0"/>
<color id="3" r="42" g="161" b="152"/>
<color id="4" r="220" g="50" b="47"/>
<color id="5" r="211" g="54" b="130"/>
@jatubio
jatubio / BaseSeeder
Created May 10, 2015 22:13
Solución alternativa a la lección 1.9 Seeders con llaves foráneas
<?php
use Illuminate\Database\Seeder;
/**
* Created by PhpStorm.
* User: kali
* Date: 10/05/2015
* Time: 13:57
*/