Skip to content

Instantly share code, notes, and snippets.

💭
AAAAAAAAAAAAAAAAAAAAAAH

Johannes Löthberg kyrias

View GitHub Profile
View source.py
import trio
import trio_asyncio
async def async_main():
async with trio_asyncio.open_loop() as loop:
pass
trio_asyncio.run(async_main)
@kyrias
kyrias / mickeygoespublic.html
Created Nov 8, 2017
Simple countdown timer until Mickey Mouse enters the public domain
View mickeygoespublic.html
<!DOCTYPE html>
<html>
<head>
<title>Mickey Goes Public</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.container {
font-size: 2em;
font-weight: bold;
font-family: sans;
@kyrias
kyrias / tf-nav-fix.user.js
Created Apr 2, 2017
TextFugu Navigation Visitation Fixer
View tf-nav-fix.user.js
// ==UserScript==
// @name TextFugu Navigation Visitation Fixer
// @namespace https://kyriasis.com/
// @version 0.1
// @description Remove #top from the end of navigation URLs so that they're listed as visited on the Lessons page.
// @author You
// @match http://www.textfugu.com/season-*
// @grant none
// ==/UserScript==
View cblrepo-helpers.zsh
#!/usr/bin/env zsh
list_ghc_cblrepo() {
cblrepo list --ghc --no-repo | sed -E 's/-xx$//'
}
list_ghc_repo() {
expac '%P' --listdelim '\n' -S ghc | grep '^haskell-' | sed -E 's/^haskell-//; s/=/ /'
}
View cVimrc
imap <C-o> editWithVim
@kyrias
kyrias / gist:d0db5ffb89cb7e90a41c
Last active Aug 29, 2015
SDS GH pages theme vote
View gist:d0db5ffb89cb7e90a41c

Comment with the name of the theme you vote for.

1 vote per person, unless explicitly allowed otherwise by me.

Slate Time Machine Minimal Modernist Hack Midnight

View top.c
/* top.c - Source file: show Linux processes */
/*
* Copyright (c) 2002-2014, by: James C. Warner
* All rights reserved. 8921 Hilloway Road
* Eden Prairie, Minnesota 55347 USA
*
* This file may be used subject to the terms and conditions of the
* GNU Library General Public License Version 2, or any later version
* at your option, as published by the Free Software Foundation.
* This program is distributed in the hope that it will be useful,
View static_typing_class.rst

Static Typing

Though dynamic languages have become far more common in recent years (e.g., Python, Lua, PHP, JS, etc.), many static languages are still in-use today and learning how to work with them is invaluable (particularly for fields such as systems programming—where static languages are far more common).

When we say "dynamic typing", what people usually mean is that the programmer does not need to annotate the variable declaration with an explicit type. That is, in Python for example, you simply declare a variable that can hold any type of data. In most static languages [#]_, we do not have this shortcut. Instead, every variable declaration must be adorned with a data type.

@kyrias
kyrias / keybase.md
Created May 28, 2014
Keybase Proof
View keybase.md

Keybase proof

I hereby claim:

  • I am kyrias on github.
  • I am johannes (https://keybase.io/johannes) on keybase.
  • I have a public key whose fingerprint is 5134 EF9E AF65 F95B 6BB1 608E 50FB 9B27 3A9D 0BB5

To claim this, I am signing this object:

@kyrias
kyrias / pomf
Created Jan 30, 2014
Upload a file to pomf.se
View pomf
#!/usr/bin/env bash
upload=$(curl -sf -F "files[]=@\"$1\"" http://pomf.se/upload.php)
geturl=$(jshon -e files -e 0 -e url -u <<< $upload)
printf "%s/%s\n" "http://a.pomf.se" "$geturl"
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.