On the Mac - run this command in Terminal
Sublime Text 2:
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Sublime Text 3:
const diffDate = (date, diff) => { | |
// date: '1993-09-11' | |
// diff: +1, -1 | |
console.log('input', date); | |
console.log('diff', diff); | |
date.setDate(date.getDate() + diff); | |
console.log('output', date); | |
const a = [ | |
date.getFullYear(), | |
('00' + (1 + date.getMonth())).slice(-2), |
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
$url = "https://scrapbox.io/api/pages/yoneda/?limit=3"; | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET"); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
$results = curl_exec($curl); | |
curl_close($curl); |
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder |
#!/bin/sh | |
# Take a PDF, OCR it, and add OCR Text as background layer to original PDF to make it searchable. | |
# Hacked together using tips from these websites: | |
# http://www.jlaundry.com/2012/ocr-a-scanned-pdf-with-tesseract/ | |
# http://askubuntu.com/questions/27097/how-to-print-a-regular-file-to-pdf-from-command-line | |
# Dependencies: pdftk, tesseract, imagemagick, hocr2pdf | |
cp $1 $1.bak | |
pdftk $1 burst output tesspage_%02d.pdf |
########### Benchmark | |
wget -qO- bench.sh | bash | |
curl -Lso- bench.sh | bash | |
########### User management | |
# allow superuser access without password |
#!/bin/sh | |
# Take a PDF, OCR it, and add OCR Text as background layer to original PDF to make it searchable. | |
# Hacked together using tips from these websites: | |
# http://www.jlaundry.com/2012/ocr-a-scanned-pdf-with-tesseract/ | |
# http://askubuntu.com/questions/27097/how-to-print-a-regular-file-to-pdf-from-command-line | |
# Dependencies: pdftk, tesseract, imagemagick, enscript, ps2pdf | |
# Would be nice to use hocr2pdf instead so that the text lines up with the PDF image. | |
# http://www.exactcode.com/site/open_source/exactimage/hocr2pdf/ |