Skip to content

Instantly share code, notes, and snippets.

View dzfranklin's full-sized avatar

Daniel Franklin dzfranklin

  • Dundee, UK
  • 19:46 (UTC +01:00)
View GitHub Profile
@dzfranklin
dzfranklin / logs.txt
Created March 23, 2021 15:17
dmesg logs on the 76da672e5ef3bd85c237770d5a53676f0923796b (the old version I could build)
[ 16.214205] evdi: [I] Initialising logging on level 5
[ 16.214206] evdi: [I] Atomic driver:yes
[ 59.420823] evdi: [D] evdi_add_devices:156 Increasing device count to 1
[ 59.421071] evdi: [D] evdi_crtc_init:389 drm_crtc_init: 0 p0000000056e75eba
[ 59.421096] evdi: [D] evdi_detect:94 (dev=0) poll connector state: disconnected
[ 59.421110] evdi evdi.0: [drm] Cannot find any crtc or sizes
[ 59.421130] evdi: [W] evdi_painter_send_update_ready_if_needed:575 Painter does not exist!
[ 59.421553] [drm] Initialized evdi 1.7.0 20200327 for evdi.0 on minor 1
[ 59.493736] evdi: [D] evdi_detect:94 (dev=0) poll connector state: disconnected
[ 59.493784] evdi: [D] evdi_painter_framebuffer_size:511 Scanout buffer not set.
@dzfranklin
dzfranklin / ExposedDropdownMenu.kt
Last active March 3, 2021 15:44
Composable ExposedDropdownMenu
package org.danielzfranklin.librereader.ui.component
import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.FocusInteraction
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.PressInteraction
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
// NOTE: PageRenderer translates coordinates and offsets relative to the start of the page
// to coordinates relative to the backing MultiParagraph, calls functions on it, and
// translates the return values
package org.danielzfranklin.librereader.ui.screen.reader.paginatedText
import android.os.Parcelable
import androidx.compose.foundation.gestures.*
import androidx.compose.foundation.text.selection.*
import androidx.compose.runtime.*
defp deps do
[
{:phoenix, "~> 1.5.3"},
{:phoenix_ecto, "~> 4.1"},
{:ecto_sql, "~> 3.4"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_dashboard, "~> 0.2.0"},
{:telemetry_metrics, "~> 0.4"},
@dzfranklin
dzfranklin / install.html
Last active April 19, 2020 15:27
Adds a calendar to the wesmaps planning page
<html>
<head>
<title>Add a Calendar to WesMaps</title>
<style>
body {
max-width: 600px;
margin-left: auto;
margin-right: auto;
margin-top: 80px;
margin-bottom: auto;
@dzfranklin
dzfranklin / btctl
Created December 31, 2019 23:20
Wrapper around bluetoothctl
#!/usr/bin/env python3
import sys
import re
import pexpect
class QuitError(Exception):
pass
Sending...
Mark set [2 times]
Sending via mail...
gnutls.c: [1] (Emacs) connecting to host: smtp.gmail.com
gnutls.c: [1] (Emacs) allocating credentials
gnutls.c: [2] (Emacs) allocating x509 credentials
gnutls.c: [2] (Emacs) using default verification flags
gnutls.c: [1] (Emacs) setting the trustfile: /etc/ssl/certs/ca-certificates.crt
gnutls.c: [1] (Emacs) gnutls callbacks
gnutls.c: [1] (Emacs) gnutls_init
@dzfranklin
dzfranklin / troubleshooting.org
Created November 24, 2019 03:36
For issue report to ob-async about issue with :var

Issue Reporting Checklist

This checklist will help you diagnose problems with your ob-async setup.

Instructions

Execute the src blocks one at a time with ctrl-c ctrl-c to ensure that ob-async-org-babel-execute-src-block is used for files

"""Computes if a credit card number is valid.
Daniel Franklin <dzfranklin@wesleyan.edu>
HW due 15 Nov 2019
"""
def normalize_input(input_str):
"""Normalize an input string into an easier to process format.
:param input_str: A string of user input in form "xxxx-xxxx-xxxx-xxxx"
@dzfranklin
dzfranklin / jump_to_saved_scroll.bookmarklet.js
Created October 13, 2016 03:53
Save the current scroll position, and then jump to it later
(function(w, g){
if(!g){
alert("Error: no saved scroll position");
return;
}
w.scrollX = g.pos[0];
w.scrollY = g.pos[1];
}(window, window.save_scroll_globals))