Skip to content

Instantly share code, notes, and snippets.

milosb793

  • At the Cloud
Block or report user

Report or block milosb793

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@milosb793
milosb793 / DatabaseCreateCommand.php
Last active Dec 21, 2019
Laravel Command used for creating database.
View DatabaseCreateCommand.php
<?php
namespace App\Console\Commands;
use PDO;
use PDOException;
use Illuminate\Console\Command;
@milosb793
milosb793 / indexes_table_max_1000.sql
Last active Dec 9, 2019
Create table with just indexes used for example for converting JSON array elements to rows: https://stackoverflow.com/a/51656467/6118794
View indexes_table_max_1000.sql
CREATE TABLE IF NOT EXISTS `t_list_row` (
`_row` int(10) unsigned NOT NULL,
PRIMARY KEY (`_row`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT t_list_row VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15), (16), (17), (18), (19), (20), (21), (22), (23), (24), (25), (26), (27), (28), (29), (30), (31), (32), (33), (34), (35), (36), (37), (38), (39), (40), (41), (42), (43), (44), (45), (46), (47), (48), (49), (50), (51), (52), (53), (54), (55), (56), (57), (58), (59), (60), (61), (62), (63), (64), (65), (66), (67), (68), (69), (70), (71), (72), (73), (74), (75), (76), (77), (78), (79), (80), (81), (82), (83), (84), (85), (86), (87), (88), (89), (90), (91), (92), (93), (94), (95), (96), (97), (98), (99), (100), (101), (102), (103), (104), (105), (106), (107), (108), (109), (110), (111), (112), (113), (114), (115), (116), (117), (118), (119), (120), (121), (122), (123), (124), (125), (126), (127), (128), (129), (130), (131), (132), (133), (134), (135), (136), (137), (13
@milosb793
milosb793 / factorial.py
Last active Jul 31, 2019
Recursive & Iterative solution of Factorial algorythm
View factorial.py
"""
About:
Script for playing with recursion in python, by calculating factorial of number n
Supported versions:
>= 2.7
Examples:
factorial.py 100
factorial.py 100 -jt (display just seconds, without results)
@milosb793
milosb793 / json-validator.py
Last active Jul 2, 2019
Simple JSON syntax validator
View json-validator.py
#!/usr/bin/python
# - * -coding: utf - 8 - * -
"""
Ultra simple and fast JSON syntax validator
Two types of JSON format supported:
- Standard format (default)
```
{
@milosb793
milosb793 / recreate_database.py
Last active Nov 8, 2017
Interactive Python script used to automate (re)creation of database using MySQL (MariaDB)
View recreate_database.py
#!/usr/bin/python
# - * -coding: utf - 8 - * -
"""
This very simple CLI application is used to automate process of recreating existing database or creating new one.
It's written in Python 3.6. and it uses MySQLdb library for connection with database.
On start, it asks for credentials. You can just skip inputs (by pressing enter) for default values.
If you don't have MySQLdb package, install it with:
`sudo apt-get install python-pip python-dev libmysqlclient-dev`
"""
You can’t perform that action at this time.