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
#!/bin/bash | |
# Converts HTML from https://exportmyposts.jazzychad.net/ exports to Markdown | |
POSTS_DIR=/Users/richard/Desktop/d6y/posts | |
for file in $POSTS_DIR/*.html | |
do | |
echo $file |
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
'use strict'; | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const functions = require('firebase-functions'); // Cloud Functions for Firebase library | |
const DialogflowApp = require('actions-on-google').DialogflowApp; // Google Assistant helper library | |
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { | |
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); | |
console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); | |
if (request.body.queryResult) { |
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
Calculating QSAR model... | |
RANDOM FOREST: 88(train), 22(test), 10 repeats | |
Warning: final_rf not assigned, so selecting last rf to continue | |
train_x: [[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
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
/* | |
The Oracle Java enum Planets example using the Klang DIY Enum, modified to include ordering. | |
*/ | |
object KlangEnumPlanets extends App { | |
trait Enum { //DIY enum type | |
import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia | |
type EnumVal <: Value //This is a type that needs to be found in the implementing class |
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
trait Debuggable { | |
fn debug(self) -> Self; | |
} | |
impl<T> Debuggable for T | |
where | |
T: Sized + std::fmt::Debug, | |
{ | |
fn debug(self) -> Self { | |
dbg!(self) |
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
trait Debuggable { | |
fn debug(self) -> Self | |
where | |
Self: Sized + std::fmt::Debug, | |
{ | |
dbg!(self) | |
} | |
} | |
impl<T> Debuggable for T {} |
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
// Override the default LocalDateTime formatting | |
// (the default splits out each date.time element as a seperate field: hour, minute, day, etc) | |
def newInstance(url: String): Pusher = { | |
import com.google.gson._ | |
import java.lang.reflect.Type | |
val localDateTimeSerializer: JsonSerializer[LocalDateTime] = new JsonSerializer[LocalDateTime] { | |
def serialize(src: LocalDateTime, typeOfSrc: Type, context: JsonSerializationContext): JsonElement = | |
new JsonPrimitive(src.toString()) |
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
~/Developer/darn via C darn | |
❯ conda install -c conda-forge jupyterlab -y | |
Collecting package metadata (current_repodata.json): done | |
Solving environment: done | |
## Package Plan ## | |
environment location: /Users/richard/opt/miniconda3/envs/darn | |
added / updated specs: |
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
Jan | Length | Difference | Additional daylight (seconds) | Length of day (hours) | |
---|---|---|---|---|---|
01/01/2020 | 08:01:54 | 01:00 | 60.00 | 8.03 | |
02/01/2020 | 08:03:01 | 01:06 | 66.00 | 8.05 | |
03/01/2020 | 08:04:14 | 01:12 | 72.00 | 8.07 | |
04/01/2020 | 08:05:33 | 01:18 | 78.00 | 8.09 | |
05/01/2020 | 08:06:57 | 01:24 | 84.00 | 8.12 | |
06/01/2020 | 08:08:27 | 01:29 | 89.00 | 8.14 | |
07/01/2020 | 08:10:02 | 01:35 | 95.00 | 8.17 | |
08/01/2020 | 08:11:43 | 01:40 | 100.00 | 8.20 | |
09/01/2020 | 08:13:28 | 01:45 | 105.00 | 8.22 |
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
#!/usr/bin/env scalas | |
/*** | |
scalaVersion := "2.11.4" | |
resolvers += Resolver.url("typesafe-ivy-repo", url("http://typesafe.artifactoryonline.com/typesafe/releases"))(Resolver.ivyStylePatterns) | |
libraryDependencies += "org.scala-sbt" % "io" % "0.13.7" |
NewerOlder