Skip to content

Instantly share code, notes, and snippets.

View Mexidense's full-sized avatar
📗
"Stay hungry. Stay foolish"

Salvador Briones Mexidense

📗
"Stay hungry. Stay foolish"
View GitHub Profile
On Terminal:
sudo apt install php7.2
sudo pecl install mongodb
sudo vi /etc/php/7.2/cli/php.ini //added extension=mongodb.so
sudo service apache2 restart
On project Laravel:
composer require jenssegers/mongodb
Jenssegers\Mongodb\MongodbServiceProvider::class, //Add on config/app.php Providers
‘Moloquent’ => Jenssegers\Mongodb\Eloquent\Model::class, //Add on config/app.php ALIAS
@Mexidense
Mexidense / Table sizes
Created December 8, 2018 23:31
How to know table sizes on mysql for one DB
SELECT
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = "<NAME_DB>"
ORDER BY
(DATA_LENGTH + INDEX_LENGTH)
DESC;
select table_name,
round(data_length/1024/1024) as data_length_mb,
round(data_free/1024/1024) as data_free_mb
from information_schema.tables
where round(data_free/1024/1024) > 5
order by data_free_mb;
mysqldump -u <USER> -p<PASSWORD> --opt --where="1 limit <FROM REGISTRY>,<TO REGISTRY>"
--default-character-set=utf8 <DB_NAME> <TABLE_NAME> > <FILE_NAME>.sql
@Mexidense
Mexidense / launch.json
Created December 16, 2018 13:17
Configuration for xDebug on VSCode and Laravel 5.7
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"ignore": [
"**/vendor/**/*.php"
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 offset-md-2">
<div class="card">
<div class="card-header">Markets</div>
<div class="card-body">
@foreach ($markets as $item)
{{$item}}
@endforeach
@Mexidense
Mexidense / services.yml
Created June 6, 2019 09:17
File for active devel and kint debuger in D8
parameters:
session.storage.options:
# Default ini options for sessions.
#
# Some distributions of Linux (most notably Debian) ship their PHP
# installations with garbage collection (gc) disabled. Since Drupal depends
# on PHP's garbage collection for clearing sessions, ensure that garbage
# collection occurs by using the most common settings.
# @default 1
gc_probability: 1
⭐️ feat: add beta sequence (new feature)
🛠 fix: remove broken confirmation message (bug fix)
♻️ refactor: share logic between 4d3d3d3 and flarhgunnstow (refactoring production code)
🌈 style: convert tabs to spaces (formatting, missing semi colons, etc; no code change)
🔍 test: ensure Tayne retains clothing (adding missing tests, refactoring tests; no production code change)
😒 chore: add Oyster build script (updating grunt tasks etc; no production code change)
📝 docs: explain hat wobble (changes to documentation)
Sources:
https://seesparkbox.com/foundry/semantic_commit_messages
@Mexidense
Mexidense / laravel-permissions.sh
Created July 15, 2019 12:09
Laravel file permissions
#from root user
chown -R $USER:www-data storage
chown -R $USER:www-data bootstrap/cache
chmod -R 775 storage
chmod -R 775 bootstrap/cache
Shitf + ? Help
1) Hover + (space) will assign/unassign you to the card.
2) Hover + (m) will allows you to add a member in the card.
3) Hover + (l) will allows you to add a label in the card.
4) Hover + (d) will allows you to set a date in the card.
5) Hover + (c) will allows you to archive a card.
6) Hover + (s) will allows you to watch a card.
7) (q) will show you only your work.