Skip to content

Instantly share code, notes, and snippets.

View nkatte's full-sized avatar

Nícolas Dornelles nkatte

View GitHub Profile
@nkatte
nkatte / seesaw-repl-tutorial.clj
Created August 22, 2025 17:24 — forked from daveray/seesaw-repl-tutorial.clj
Seesaw REPL Tutorial
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@nkatte
nkatte / 50-udisks.rules
Created February 15, 2025 19:01 — forked from Scrumplex/50-udisks.rules
Polkit rules for udisks, and udisks2. Compatible with udiskie and Dolphin.
// Original rules: https://github.com/coldfix/udiskie/wiki/Permissions
// Changes: Added org.freedesktop.udisks2.filesystem-mount-system, as this is used by Dolphin.
polkit.addRule(function(action, subject) {
var YES = polkit.Result.YES;
// NOTE: there must be a comma at the end of each line except for the last:
var permission = {
// required for udisks1:
"org.freedesktop.udisks.filesystem-mount": YES,
"org.freedesktop.udisks.luks-unlock": YES,
@nkatte
nkatte / fmt.h
Created November 16, 2022 15:10 — forked from tylov/fmt_print.h
Lightweight fmt_print() function for C11
#ifndef FMT_INCLUDED
#define FMT_INCLUDED
/*
void fmt_print(dst, fmt, ...);
dst - destination: either int (1=stdout, 2=stderr), FILE*, or a char* buffer
fmt - format string
{} - Auto-detected format. If :MOD is not specified,
float will use ".8g" format, and double ".16g".
{:MOD} - Format modifiers: < left align (replaces -), > right align (default).
@nkatte
nkatte / vagrant-kvm.md
Created April 17, 2017 00:20 — forked from yuanying/vagrant-kvm.md
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user

#!/bin/bash
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
@nkatte
nkatte / login.html
Created October 28, 2015 04:09 — forked from guillaumevincent/login.html
Basic authentication on Tornado with a decorator
<div id="main-container">
<div id="main">
<h1>
<img alt="scubabook logo" src="{{ static_url("img/logo.png") }}">
</h1>
<div id="login-form">
<form action="/auth/login/" method="post" id="login_form">
<fieldset>
<label for="username">Username</label>
<input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value="">
@nkatte
nkatte / background_flask.py
Created October 14, 2015 05:33 — forked from czardoz/background_flask.py
Simple Flask app with a background task using gevent
import gevent
import gevent.monkey
gevent.monkey.patch_all()
from gevent.pywsgi import WSGIServer
from flask import Flask
app = Flask(__name__)
app.debug = True
@nkatte
nkatte / INSTALL.txt
Created September 30, 2015 00:26 — forked from mrjoes/INSTALL.txt
Dead simple broker on top of sockjs-tornado
1. pip install -r reqs.pip
2. server.py
3. open client.html in browser
4. redis-cli publish push '123456'
5. check browser console