Skip to content

Instantly share code, notes, and snippets.

Milos Tomic tmilos

Block or report user

Report or block tmilos

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
@tmilos
tmilos / Reset_MYSQL_root_password.md
Last active May 17, 2018
Reset MYSQL root password
View Reset_MYSQL_root_password.md
# Stop MySQL
sudo service mysql stop
# Make MySQL service directory.
sudo mkdir /var/run/mysqld
# Give MySQL user permission to write to the service directory.
sudo chown mysql: /var/run/mysqld
# Start MySQL manually, without permission checks or networking.
sudo mysqld_safe --skip-grant-tables --skip-networking &
# Log in without a password.
@tmilos
tmilos / tmilos_on_gmail.gpg
Last active May 12, 2018
My GPG Public Key
View tmilos_on_gmail.gpg
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFr3St8BEADTSsMMG/XSWU3RQYrTp76jKcNlqadhJpOWpe65dFD/WMkoC84u
2AserM8QfPxQSSOgBNVOVGVfRBO8Q4TwVaYUsknDoqkZOOM8jEcyWrxthKc/K8bK
ljAVTNwx4FHS2FAtbrSH02kMGxivHk5s1Bji+1oW0kMclhqI1rGCN+e6oziEyhfS
vuRAI/mrq2oyNt6O+rIQvWo1rAoRmRnbzLmyfxQP+wWpnl7w+nSt/xzvGdWE5c+t
gjv5xFQLsdc+hAsS6y8K4QbfoNOmXTxdT2mYWhVqqt2GJ7PQayN0I0lSs0vOY29Z
ubOh3/g8bp3nTqJqQoYEB3IgcYJWqTdaLjCvVrGYx3eyXzjsb5ZT2FZRjd8Q/OvX
LI43NtkWi24GCx8sNIpkWrmz7auSNs31r0F/F6qauIeKpy1ZGuVaoPBmHe9zvd/p
View ldap_read_users.php
<?php
$ldapconn = ldap_connect('domain.com')
or die("Could not connect to LDAP server.");
$un = 'domain\\username';
$pw = 'password';
$ldapbind = ldap_bind($ldapconn, $un, $pw);
@tmilos
tmilos / index.js
Last active May 31, 2016
NodeJS Promises
View index.js
"use strict";
const Promise = require('bluebird')
class MyAction {
constructor (name, nextAction, preFail, postFail) {
this.name = name
this.nextAction = nextAction
this.preFail = preFail
@tmilos
tmilos / arabic.php
Created Nov 25, 2015
Arabic translation dummy generator
View arabic.php
<?php
$fileTemplate = __DIR__.'/../../app/Resources/translations/messages.%s.xliff';
$fromLocale = 'en';
$toLocale = 'ar';
$sourceFile = sprintf($fileTemplate, $fromLocale);
$targetFile = sprintf($fileTemplate, $toLocale);
$stringLetters = <<<EOT
ض
@tmilos
tmilos / README.md
Last active Oct 7, 2019
Modified Preorder Tree Traversal
View README.md

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

View gist:113f9d7884ea58112efa
### Keybase proof
I hereby claim:
* I am tmilos on github.
* I am tmilos (https://keybase.io/tmilos) on keybase.
* I have a public key whose fingerprint is 2906 0696 3E16 7038 78FE B234 DF2A A652 71C9 1CE4
To claim this, I am signing this object:
@tmilos
tmilos / foo.json
Created Oct 21, 2014
testing gist
View foo.json
{
"foo": "bar"
}
You can’t perform that action at this time.