Skip to content

Instantly share code, notes, and snippets.

View ddavaham's full-sized avatar
🎯
Focusing

David Davaham ddavaham

🎯
Focusing
View GitHub Profile
@ddavaham
ddavaham / create-mysql.bash
Created January 8, 2018 15:58 — forked from askz/create-mysql.bash
Simple bash script to create mysql db, user with generated password
#!/bin/bash
# The script will fail at the first error encountered
set -e
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
@ddavaham
ddavaham / macro.md
Created December 2, 2017 17:59 — forked from brunogaspar/macro.md
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

@ddavaham
ddavaham / id_ranges.md
Created December 1, 2017 08:48 — forked from a-tal/id_ranges.md
EVE Online ID ranges
from to description
0 10,000 System items (including junkyards and other special purpose items
500,000 1,000,000 Factions
1,000,000 2,000,000 NPC corporations
3,000,000 4,000,000 NPC characters (agents and NPC corporation CEO's)
9,000,000 10,000,000 Universes
10,000,000 11,000,000 NEW-EDEN Regions
11,000,000 12,000,000 Wormhole Regions
20,000,000 21,000,000 NEW-EDEN Constellations