Skip to content

Instantly share code, notes, and snippets.

from matrix_client.client import MatrixClient
client = MatrixClient("https://matrix.org", token="sekrit_token", user_id="@skavrate:matrix.org")
offtopic = client.rooms["!UcYsUzyxTGDxLBEvLz:matrix.org"]
offtopic.modify_user_power_levels({"Half-Shot:half-shot.uk": 100,
"skaverat:skaverat.net": 100})
@non-Jedi
non-Jedi / gist:0e3f77681bb469a294596531136a8069
Last active August 26, 2018 19:53
Julia 1.0.0 build error
make prefix=/usr sysconfdir=/etc USE_SYSTEM_LLVM=1 USE_LLVM_SHLIB=1
Warning: git information unavailable; versioning information limited
Warning: git information unavailable; versioning information limited
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 497 100 497 0 0 1956 0 --:--:-- --:--:-- --:--:-- 1956
100 152k 100 152k 0 0 192k 0 --:--:-- --:--:-- --:--:-- 1218k
rm: cannot remove 'scratch/utf8proc-97ef668b312b96382714dbb8eaac4affce0816e6/': No such file or directory
ar: creating libutf8proc.a
@non-Jedi
non-Jedi / benchmark.jl
Created March 16, 2019 00:07
Benchmarking HTTP.jl
using HTTP
abstract type DummyConnectionLayer{Next <: HTTP.Layer} <: HTTP.Layer end
st = HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{
HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{
DummyConnectionLayer{Union{}}}}}}
uri = HTTP.URI("https://example.com/random/path?query=param&foo=bar")
headers = HTTP.Headers()
@non-Jedi
non-Jedi / isnothing_replacement.jl
Created May 8, 2019 20:03
Script used as first pass on converting https://github.com/GiovineItalia/Gadfly.jl/pull/1278 from using "isnothing" to using "=== nothing". Didn't work perfectly, but it was close.
import CSTParser: EXPR, Call, IDENTIFIER
import DocumentFormat: Edit, apply, pass, State
isnothing_pass(x, state) = nothing
function isnothing_pass(x::EXPR{Call}, state)
if length(x) === 4 # filter out calls like myfunction()
id, p1, contents, p2 = x
if id isa IDENTIFIER && id.val == "isnothing"
push!(state.edits, Edit(state.offset+1:state.offset+id.fullspan+1, ""))
using Printf
struct FWrapper
val::Float64
end#struct
Base.show(io::IO, f::FWrapper) = @printf(io, "%E", f.val)
x = [1.2E-9, 0.03]
xwrap = FWrapper.(x)
client-request (id:1) Thu May 7 11:20:43 2020:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 1241 :rootPath "/home/adam/tmp/" :rootUri "file:///home/adam/tmp/" :initializationOptions nil :capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
:workspaceEdit
(:documentChanges :json-false)
:didChangeWatchedFiles
(:dynamicRegistration t)
[client-request] (id:1) Wed May 20 19:46:53 2020:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 1689 :rootPath "/Users/evar/Base/_Code/uni/stochastic/" :rootUri "file:///Users/evar/Base/_Code/uni/stochastic/" :initializationOptions nil :capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
:workspaceEdit
(:documentChanges :json-false)
:didChangeWatchedFiles
(:dynamicRegistration t)
Warning: git information unavailable; versioning information limited
Warning: git information unavailable; versioning information limited
Warning: git information unavailable; versioning information limited
Warning: git information unavailable; versioning information limited
Warning: git information unavailable; versioning information limited
Warning: git information unavailable; versioning information limited
PERL base/pcre_h.jl
PERL base/errno_h.jl
CC usr/lib/libccalltest.so
FLISP src/julia_flisp.boot
;;; jupyter-config.el --- config emacs-jupyter -*- lexical-bindings:t -*-
;; hack since libzmq won't build properly on void for some reason
;(setenv "ZMQ_CFLAGS" "-I/usr/local/include")
;(setenv "ZMQ_LIBS" "-L/usr/local/lib")
(setenv "ZMQ_VERSION" "4.3.4")
(straight-use-package '(zmq :type git :host github
:repo "dzop/emacs-zmq"
:files (:defaults "Makefile" "src" "*.so")))
(straight-use-package '(jupyter :type git :host github
:repo "non-jedi/emacs-jupyter" :branch "devel"