This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
CENTOS_BOX="serveit/centos-7" | |
UBUNTU_BOX="generic/ubuntu1710" | |
DEBIAN_BOX="generic/debian9" | |
SH_FILE="/root/install.sh" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'new_root'@'%' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON *.* TO new_root@'%' IDENTIFIED BY 'password' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
"time" | |
"github.com/astaxie/beego/httplib" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BinarySourceTree<T> where T:IComparable | |
{ | |
/* BİNARY SOURCE TREE | |
___ ___________ ____ | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | ROOT | | | |
| | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Virtualenv | |
sudo pip install virtualenv | |
or | |
sudo apt-get install python-virtualenv | |
in the project | |
virtualenv venv | |
. venv/bin/activate | |
after install Flask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps aux | grep "/usr/bin/kvm -id VMID" | |
kill -9 PID | |
qm start VMID | |
qm list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def firstOfMonth(day): | |
resultDate = day.replace(day=1) | |
if ((day - resultDate).days > 25): | |
resultDate = resultDate + relativedelta(months=1) | |
return resultDate | |
def lastOfMonth(any_day): | |
next_month = any_day.replace(day=28) + datetime.timedelta(days=4) # this will never fail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$collection = app(Post::class); | |
//if tags | |
$collection = $collection-> | |
whereHas('tags', function ($query) use ($t) { | |
$query->where('tag_id','=', $t); | |
}); | |
//if languages | |
$collection = $collection->whereHas('languages', function ( $query ) use ( $l ){ | |
$query->where('language_id', '=',$l); |