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 getBlock = async (selectedText) => { | |
const currentBlock = logseq.api.get_current_block(); | |
if (currentBlock) { | |
const newText = `[${selectedText}](())` | |
const updatedContent = currentBlock.content.replace( | |
selectedText, newText | |
); | |
await logseq.api.update_block( | |
currentBlock.uuid, | |
updatedContent |
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
@prefix : <urn:webprotege:ontology:d2c83e7f-4c1f-4d5d-9e25-b6561f887f46#> . | |
@prefix owl: <http://www.w3.org/2002/07/owl#> . | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix xml: <http://www.w3.org/XML/1998/namespace> . | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
@base <urn:webprotege:ontology:d2c83e7f-4c1f-4d5d-9e25-b6561f887f46> . | |
<urn:webprotege:ontology:d2c83e7f-4c1f-4d5d-9e25-b6561f887f46> rdf:type owl:Ontology . |
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
# For MacOS, non conda environment | |
xcode-select --install # install gcc, command line tools if not present | |
brew install swig # install wrapper, interface between C/C++ libarires (needed for pyrfr) | |
# Now we can install auto-sklearn, by installing the pyrfr dependency first | |
PIP_NO_CACHE_DIR=false | |
pip install pyrfr auto-sklearn # could use pipenv too | |
# if in Docker, can remove command line tools, etc. |
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 python:3.6.2-slim | |
MAINTAINER "Kwame Porter Robinson" [email protected] | |
# Install JDK | |
# Credit: picoded/ubuntu-openjdk-8-jdk | |
# Add some core repos | |
RUN apt-get update && \ | |
apt-get install -y sudo curl zip openssl build-essential python-software-properties software-properties-common && \ | |
apt-get clean; |
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
app_id: PoolBasedBinaryClassification | |
args: | |
alg_list: | |
- {alg_id: RoundRobin, alg_label: RoundRobin, test_alg_label: Test} | |
- {alg_id: RandomSamplingLinearLeastSquares, alg_label: RandomSamplingLinearLeastSquares, test_alg_label: Test} | |
algorithm_management_settings: | |
mode: fixed_proportions | |
params: | |
- {alg_label: RoundRobin, proportion: 0.5} | |
- {alg_label: RandomSamplingLinearLeastSquares, proportion: 0.5} |
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 MIT License | |
# | |
#Copyright (c) 2016 Kwame Porter Robinson | |
# | |
#Permission is hereby granted, free of charge, to any person obtaining a copy | |
#of this software and associated documentation files (the "Software"), to deal | |
#in the Software without restriction, including without limitation the rights | |
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
#copies of the Software, and to permit persons to whom the Software is | |
#furnished to do so, subject to the following conditions: |
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 itertools import chain, repeat | |
from six.moves import reduce | |
def reducer(accum_value, x): | |
return tuple(sum(t) for t in zip(accum_value, x + (1,))) | |
k = (item for item in ((3,4),(4,66),(100,4))) | |
start = next(k)+(1,) | |
t = reduce(reducer, k, start) |
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
<script> | |
// Adapted from http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ | |
// Works for fast typers (90+ wpm), no node.js | |
var debounce = function (func, threshold, execAsap) { | |
var timeout; | |
return function debounced () { | |
var obj = this, args = arguments; | |
function delayed () { | |
if (!execAsap) |
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 airflow import DAG | |
from airflow.operators import BashOperator, DummyOperator | |
from datetime import datetime, timedelta | |
default_args = { | |
'owner':'kwame', | |
'depends_on_past':True, | |
'start_date': datetime.today()-timedelta(days=7) | |
} |
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 python | |
import urllib | |
class Worker(object): | |
def __init__(self, myurl): | |
self.myurl = myurl | |
def dowork(self): | |
resp = urllib.request.urlopen(self.myurl) |