Skip to content

Instantly share code, notes, and snippets.

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

Franco Salcedo francosalcedo

🏠
Working from home
  • Lima, Perú
View GitHub Profile
@francosalcedo
francosalcedo / mysql-sail.md
Created September 1, 2023 17:26 — forked from jjsquady/mysql-sail.md
Laravel Sail - GRANT ALL PRIVILEGES to user

Run this command in sail project folder:

docker-compose exec mysql bash

execute the mysql -u root -p command

provide the default password password

then executes

@francosalcedo
francosalcedo / DatabaseSeeder.php
Created May 24, 2018 16:42 — forked from bgallagh3r/DatabaseSeeder.php
Disable Foreign Key Constraints when Seeding DB with Artisan Migrate/DB Seed This prevents SQL from throwing errors when you try to do DB::table()->truncate() as TRUNCATE is disallowed when FK constraints are in place.
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
@francosalcedo
francosalcedo / Install-Mcrypt.md
Created April 16, 2018 02:37 — forked from idleberg/Install-Mcrypt.md
Install Mcrypt on macOS

Setup php-mycrypt on macOS (and versions of Mac OS X)

These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.

Install

Install Mcrypt using Homebrew

# PHP 7
@francosalcedo
francosalcedo / pm_install.sh
Created March 7, 2018 13:16 — forked from punkdata/pm_install.sh
Postman Install Ubuntu 17.10
#!/usr/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
@francosalcedo
francosalcedo / shake.xml
Created November 12, 2017 21:03 — forked from simon-heinen/shake.xml
Simple efecto sacudir (shake) android studio
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
android:duration="70"
android:fromDegrees="-5"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="5"
android:repeatMode="reverse"
(function() {
var preTags = document.getElementsByTagName('pre');
var preWithHeaderInfo = preTags[0];
var preWithContent = preTags[2];
var lines = preWithContent.textContent.split('\n');
// get data about the formatting (changes between different versions of chrome)
var rgx = /^(0{8}:\s+)([0-9a-f]{2}\s+)[0-9a-f]{2}/m;
var match = rgx.exec(lines[0]);
@francosalcedo
francosalcedo / .htaccess
Created October 25, 2017 17:47 — forked from Zodiac1978/.htaccess
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Protect XMLRPC (needed for Apps, Offline-Blogging-Tools, Pingback, etc.)
# If you use that, these tools will not work anymore