This file contains hidden or 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
var platform = new H.service.Platform({ | |
useCIT: true, | |
app_id: '{YOUR_APP_ID}', // // <-- ENTER YOUR APP ID HERE | |
app_code: '{YOUR_APP_CODE}', // <-- ENTER YOUR APP CODE HERE | |
}); | |
var maptypes = platform.createDefaultLayers(); | |
var map = new H.Map(document.getElementById('map'), maptypes.terrain.map, { | |
zoom: 9, | |
center: { lat: 41.884238, lng: -87.638862 } |
This file contains hidden or 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(NS) { | |
var APP_ID = '{YOUR_APP_ID}', // // <-- ENTER YOUR APP ID HERE | |
APP_CODE = '{YOUR_APP_CODE}'; // <-- ENTER YOUR APP CODE HERE | |
function Mobility(options) { | |
this.map = options.map; | |
} | |
Mobility.prototype = { |
This file contains hidden or 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://mobility.api.here.com/v1/route | |
?app_id={YOUR_APP_ID} | |
&app_code={YOUR_APP_CODE} | |
&profile=parkandride | |
&dep={YOUR_START_POINT} | |
&arr=41.884238,-87.638862 | |
&time=2018-03-20T07:30:00 |
This file contains hidden or 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
{ | |
"Res": { | |
"Connections": { | |
"Connection": [ | |
{ | |
"@duration": "PT2H3M33S", | |
"@transfers": "2", | |
"Sections": { | |
"Sec": [ | |
{ |
This file contains hidden or 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
var mobility = new H.Mobility({ | |
map: map, | |
app_id: '{YOUR_APP_ID}', // <-- ENTER YOUR APP ID HERE | |
app_code: '{YOUR_APP_CODE}', // <-- ENTER YOUR APP CODE HERE | |
}); | |
var ui = mobility.createDefaultUI(); | |
mobility.route({ | |
dep: {YOUR_START_POINT}, // <-- ENTER YOUR START POINT HERE |
This file contains hidden or 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 command(args): | |
pass | |
parser = argparse.ArgumentParser() | |
subparser = parser.add_subparsers(title="subcommands") | |
command_parser = subparser.add_parser("command") | |
command_parser.set_defaults(func=command) | |
command_parser.add_argument("--dummy", help="some arg to the subcommand") | |
args = parser.parse_args() |
This file contains hidden or 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
set FROM_EXT mp4 | |
set TO_EXT mkv | |
set ABR 128k | |
set CRF 22 | |
for i in *.$FROM_EXT | |
set BASENAME (basename $i .$FROM_EXT) | |
set DIRNAME (dirname $i) | |
nice -n 19 time ffmpeg -i "$DIRNAME/$BASENAME.$FROM_EXT" -vcodec libx265 -crf $CRF -ac 2 -c:a libmp3lame -b:a $ABR output.$TO_EXT; and \ | |
mv output.$TO_EXT "$DIRNAME/$BASENAME.$TO_EXT"; and \ | |
rm "$i" |
This file contains hidden or 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 apt install google-drive-ocamlfuse # to mount google drive as a pseudo fs | |
sudo apt install athena-jot # for generating the list of {A..Z} in fish shell on the fly | |
sudo apt install parallel # to control running jobs in parallel | |
# set up google drive, see https://github.com/astrada/google-drive-ocamlfuse/wiki/Authorization | |
google-drive-ocamlfuse | |
# mount google drive | |
set DRIVE_DIR GoogleDrive | |
google-drive-ocamlfuse ~/$DRIVE_DIR/ |
This file contains hidden or 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
UNKNOWN_OBJECT.getClass.getDeclaredFields.foreach(v => println(s"${v.getName}: $v")) |
This file contains hidden or 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 throwingFunction(): Unit = throw RuntimeError() | |
// own implementation of assertThrows | |
def assertThrows[E](f: => Unit)(implicit eType:ClassTag[E]): Unit = | |
try f | |
catch | |
case _: E => return | |
case e: Any => Assertions.fail(s"Expected ${eType.runtimeClass.getName} got ${e.getClass}") | |
Assertions.fail(s"Expected ${eType.runtimeClass.getName}") |
OlderNewer