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
# This is a note of https://blog.pjsen.eu/?p=440 | |
I did a little research and have found that GIT Bash uses MINGW compilation of GNU tools. | |
It uses only selected ones. | |
You can install the whole distribution of the tools from https://www.msys2.org/ | |
and run a command to install Tmux. And then copy some files to installation folder of Git. | |
This is what you do: | |
Install before-mentioned msys2 package and run bash shell | |
Install tmux using the following command: pacman -S tmux |
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
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.chrome.options import Options | |
import time | |
# 设置ChromeDriver路径 注意不要下载成了无头模式的chrome-headless-shell | |
chrome_driver_path = r"C://AMD//chromedriver.exe" | |
service = Service(executable_path=chrome_driver_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
tail -n0 -F logs/lastest.log | grep --line-buffered INFO| xargs -I @ curl -s \ | |
https://hooks.slack.com/AAAAAAAA/BBBBBBB/CCCCCC \ | |
-X POST \ | |
-H 'Content-type: application/json' \ | |
--data '{"username":"curl", "text":"@"}' |
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
from enum import Enum, unique | |
@unique | |
class Side(Enum): | |
Buy = 0 | |
Sell = 1 | |
class OrderType(Enum): | |
Market = 0 | |
Limit = 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
def lookahead(iterable): | |
"""Pass through all values from the given iterable, augmented by the | |
information if there are more values to come after the current one | |
(True), or if it is the last value (False). | |
""" | |
# Get an iterator and pull the first value. | |
it = iter(iterable) | |
last = next(it) | |
# Run the iterator to exhaustion (starting from the second value). | |
for val in it: |
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 time; | |
ts = time.time() | |
print(ts) | |
# 1514116641.1691682 | |
# 小数点后七位,也就是100ns | |
import datetime; | |
ts = datetime.datetime.now().timestamp() | |
print(ts) | |
# 1514116641.171174 |
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
cat input.xml | awk '{ | |
gsub(/></,">\n<") | |
}1' | sed -e 's/^/ /' -e 's/ <\//<\//' |
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
function onOpen() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var entries = [{name : "Check Duplicates",functionName : "checkDuplicates"}]; | |
sheet.addMenu("Scripts", entries); | |
}; | |
function checkDuplicates() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
//var dataRange = sheet.getDataRange(); | |
var dataRange = sheet.getRange("A:A"); // Set Any Range |
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
function SHA256_BIN(input){ | |
var binstr = ''; | |
var digest = Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_256, input); | |
for (i = 0; i < digest.length; i++) { | |
var val = (digest[i]+256) % 256; | |
var hexstring= ('0'+val.toString(16)).slice(-2); | |
var bytestring = Number('0x' + hexstring).toString(2); | |
padded_bytestring=String("00000000" + bytestring).slice(-8); // returns 00123 | |
binstr += padded_bytestring; | |
} |
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
# without submodule | |
-- Remove the history from | |
rm -rf .git | |
-- recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repos ensuring you overwrite history |
NewerOlder