javascript:!function(a){var b=document.createElement("textarea"),c=document.getSelection();b.textContent=a,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)}("["+document.title+"]("+document.location+")");
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
FOV = 90.0 | |
plane_depth = DepthConversion(depth, FOV) | |
plt.imshow(applyColorMap(plane_depth)) | |
H, W = depth.shape | |
x = np.arange(W) | |
y = H / 2 | |
plt.plot(x, depth[y,x],label='distance from camera center') | |
plt.plot(x, plane_depth[y,x],label='distance from camera plane') | |
plt.legend() |
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 node app.js | |
devices to be scanned: B1_6,B1_7,B1_8,B2_6,B2_7,B2_8,B2_9,B2_10 | |
B2_7: started receiving notification | |
B1_8: started receiving notification | |
B1_6: started receiving notification | |
B2_8: started receiving notification | |
B2_10: started receiving notification | |
{ value: 141, segment_code: 'B2_7' } | |
{ value: 611, segment_code: 'B1_8' } | |
B1_7: started receiving notification |
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
const puppeteer = require('puppeteer'); | |
const URL_BASE = 'https://assistant.google.com/'; | |
const locale = process.argv[2]; // 'ja-JP', 'en-US', etc... | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const categories = await getElements(browser, `${URL_BASE}explore?hl=${locale}`, _ => { | |
var elements = document.getElementsByClassName('DH6Rkf-ibnC6b'); |
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
URL_BASE='https://assistant.google.com/' | |
locale=$1 | |
categoryUrls=( | |
`node load-aog-html.js "${URL_BASE}explore?hl=${1}" waitLazyLoad | pup 'li.DH6Rkf-ibnC6b a.hSRGPd[jslog] json{}' | jq '.[].href' -r | sort | uniq` | |
) | |
for category in "${categoryUrls[@]}" | |
do | |
subCategoryUrls=( | |
`node load-aog-html.js "${URL_BASE}${category}" waitLazyLoad | pup 'div.v4cdld-r6IkTd div[jscontroller="ynTBf"] json{}' | jq '.[]."data-link"' -r | sed s/amp\;//g` | |
) |
regular expression:
^\s+\"(.*)({.+})(.*)\",*
converted result:
$1●●●$3
A command to add a transparent area to a non-square image to make it square and centered
convert infile -background transparent -gravity center -extent '1024x1024' outfile
referenced: https://stackoverflow.com/questions/11833599/add-lines-of-transparent-pixels-to-image-using-command-line
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
--- /home/ec2-user/anaconda3/lib/python3.6/argparse.py 2018-04-29 16:18:42.000000000 +0000 | |
+++ argparse.py 2018-08-13 02:30:36.317112960 +0000 | |
@@ -1064,6 +1064,7 @@ | |
prog, | |
parser_class, | |
dest=SUPPRESS, | |
+ required=False, | |
help=None, | |
metavar=None): |
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
http://bl.ocks.org/mayosuke/151f8c7cf195a72a71ef |
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
# hcidump -R の出力を改行無しにする | |
sudo hcidump -i hci0 -R | ruby -ne 'BEGIN{l = ""}; $_.strip!; if $_[0] == ">" then puts l; l = $_ else l << " " << $_ end' | |
# ruby one-liner | |
ruby -E UTF-8 -ne "print $_ if $_.include? 'hoge' or $_.include? 'fuga'" strings.xml | |
# gitリポジトリが管理するファイルのリスト表示 | |
git ls-files | |
# gitリポジトリのログをツリー表示 |
NewerOlder