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
# Forced pull from origin (with local overwrites) | |
git fetch --all | |
git reset --hard origin/master | |
# .gitingore file for ignoring directory content | |
* | |
!.gitignore |
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
kill -9 $(ps aux | grep text_pattern | awk '{print $2}') # group process kill with filters | |
lsof -i :7777 #Check socket/port information | |
grep -Ril 'pattern' # find all files containing specific text on Linux |
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
postgres=# SELECT now(), current_date, current_time, current_time - '1m'::interval, now() - '1m'::interval; | |
now | date | timetz | ?column? | ?column? | |
-------------------------------+------------+--------------------+--------------------+------------------------------- | |
2018-10-08 13:20:55.115306+00 | 2018-10-08 | 13:20:55.115306+00 | 13:19:55.115306+00 | 2018-10-08 13:19:55.115306+00 | |
postgres=# select extract(dow from current_date); | |
date_part | |
----------- | |
1 |
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
<script> | |
function send_post() { | |
request = $.ajax({ | |
url: "/url/", | |
type: "post", | |
data: 'forn_name='+JSON.stringify({'key':'value'}) | |
}); | |
request.done(function (response, textStatus, jqXHR){ | |
console.log("Succesful!"); |
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
import subprocess | |
import os | |
import signal | |
import time | |
path = os.path.abspath(__file__).rpartition('/')[0] | |
child_comm = ['python %s/child.py' % path] | |
parent_comm = ['python %s/parent.py' % path] |
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 | |
pandas.DataFrame([], columns=['column1','column2']) | |
pandas.DataFrame(data={'column1':[1,2,3], 'column2': ['1','2','3']}) | |
pandas.DataFrame([[1,1], [2,2]], columns=['column1','column2']) | |
#*** Get | |
df.values | |
df.columns | df.keys() |