Skip to content

Instantly share code, notes, and snippets.

View johtso's full-sized avatar
🤖

Johannes johtso

🤖
View GitHub Profile
@johtso
johtso / index.ts
Created February 24, 2023 15:04 — forked from huw/README.md
Remix, Sentry & Cloudflare Workers
import * as build from "@remix-run/dev/server-build";
import { createRoutes } from "@remix-run/server-runtime/dist/routes";
import { Dedupe, ExtraErrorData, Transaction } from "@sentry/integrations";
import { hasTracingEnabled } from "@sentry/tracing";
import { Toucan } from "toucan-js";
import createEventHandler from "./createEventHandler";
import instrumentBuild, { getTransactionName, startRequestHandlerTransaction } from "./instrumentBuild";
interface Environment {
__STATIC_CONTENT: KVNamespace<string>;
// Name: daily note
// Description: Open today's daily note in obsidian
// You must install the Actions URI plugin and have the daily notes plugin enabled
// Currently MacOS only
import "@johnlindquist/kit"
import { homedir } from "os"
import { join as joinPath } from "path"
@johtso
johtso / daily-note.ts
Created February 13, 2023 23:04
Open today's daily note in Obsidian
// Name: daily note
// Description: Open today's daily note in obsidian
// You must install the Actions URI plugin and have the daily notes plugin enabled
// Currently MacOS only
import "@johnlindquist/kit"
import { homedir } from "os"
import { join as joinPath } from "path"
@johtso
johtso / canvas-drawing-7gui-tasks-challenge-keyframers-7-8-6.markdown
Created April 25, 2022 12:47
Canvas Drawing! | 7GUI Tasks Challenge | @keyframers 7.8.6
@johtso
johtso / gist:5881137
Last active February 18, 2021 18:37
Django Rest Framework underscore <-> camelcase conversion
import re
from rest_framework import serializers, renderers, parsers
class JSONRenderer(renderers.JSONRenderer):
def render(self, data, *args, **kwargs):
if data:
data = recursive_key_map(underscore_to_camelcase, data)
return super(JSONRenderer, self).render(data, *args, **kwargs)
import inspect
from typing import Callable, Generator, Awaitable, TypeVar, Union
YieldType = TypeVar("YieldType")
SendType = TypeVar("SendType")
ReturnType = TypeVar("ReturnType")
def friendly_generator_decorator(
genfunction: Callable[..., Generator[YieldType, SendType, ReturnType]],
handler: Callable[[YieldType], Union[Awaitable[SendType], SendType]],
@johtso
johtso / tott_rate_monitor.py
Created May 27, 2016 09:23
Output counts of URLs scanned on URLTeam project
import sys
import json
import websocket
ws = websocket.create_connection('ws://tracker.archiveteam.org:1337/api/live_stats')
username = sys.argv[1]
while True:
data = json.loads(ws.recv()).get('live_new')
from kivy.app import App
from kivy.uix.button import Button
from android import activity
__version__ = '0.0.1'
class MyApp(App):
def __init__(self, *args, **kwargs):
super(MyApp, self).__init__(*args, **kwargs)
Entering in ARM enviromnent
Compiler found at /Users/human/.buildozer/android/platform/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin//arm-linux-androideabi-gcc
/Users/human/Code/kivy/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
creating build
creating build/temp.macosx-10.4-x86_64-2.7
creating build/temp.macosx-10.4-x86_64-2.7/jnius
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /Users/human/.buildozer/android/platform/android-ndk-r9/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /Users/human/.buildozer/android/platform/android-ndk-r9/platforms/android-14/arch-arm -I/Users/human/Code/kivy/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.macosx-10.4-x86_64
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<Folder>
<name>a name</name>
<description>Here are multiple maps displayed in one</description>
<NetworkLink>
<open>0</open>