Skip to content

Instantly share code, notes, and snippets.

@tmilos
tmilos / foo.json
Created October 21, 2014 05:42
testing gist
{
"foo": "bar"
}
### 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 / README.md
Last active March 18, 2024 05:34
Modified Preorder Tree Traversal

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

@tmilos
tmilos / arabic.php
Created November 25, 2015 14:45
Arabic translation dummy generator
<?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 / index.js
Last active May 31, 2016 13:10
NodeJS Promises
"use strict";
const Promise = require('bluebird')
class MyAction {
constructor (name, nextAction, preFail, postFail) {
this.name = name
this.nextAction = nextAction
this.preFail = preFail
<?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 / tmilos_on_gmail.gpg
Last active May 12, 2018 20:20
My GPG Public Key
-----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
@tmilos
tmilos / Reset_MYSQL_root_password.md
Last active May 17, 2018 11:11
Reset MYSQL root password
# 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.