Skip to content

Instantly share code, notes, and snippets.

Jonne Haß jhass

Block or report user

Report or block jhass

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
keplersj /
Created Jul 25, 2015
Gist demonstrating the ability to run Crystal code from Rust.
#[link(name = "logger")]
extern {
fn CrystalLog(text: *const u8);
fn log(text: &'static str) {
unsafe{ CrystalLog(text.as_bytes().as_ptr()) };
fn main() {
datanoise /
Last active Mar 8, 2019
ctags for crystal language
require "compiler/crystal/**"
require "option_parser"
include Crystal
class ToCtagsVisitor < Visitor
@filename : String
@lines : Array(String)
@io : IO
@opts : Generator
jhass /
Last active Dec 31, 2019
My Ruby setup on Archlinux

Ruby on Archlinux

I thought I would document my setup, since it's somewhat non-standard but working quite well for me.

What this does

  • Install major Ruby versions at their latest patch release
  • Allow to switch between them seamlessly
  • Use chruby
  • Encourage bundler usage
jhass / vmm-change-password[slash]index.php
Last active Aug 29, 2015
Afterlogic WebMail VMM password change plugin
View vmm-change-password[slash]index.php
* Afterlogic WebMail VMM password change plugin
* Based upon
* VMM:
* WebMail lite:
* The plugin calls doveadm pw.
* You should create a dedicated role and add it to the mailsys role.
skanev / rubocop.rb
Last active Feb 5, 2020
A Rubocop wrapper that checks only added/modified code
View rubocop.rb
#!/usr/bin/env ruby
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.
# Here are some options you can pass in addition to the ones in rubocop:
jhass / mod_auth_diaspora.lua
Last active Mar 15, 2018
Prosody authentication for Diaspora. Tested with Prosody 0.9.4. See
View mod_auth_diaspora.lua
-- Based on Simple SQL Authentication module for Prosody IM
-- Copyright (C) 2011 Tomasz Sterna <>
-- Copyright (C) 2011 Waqas Hussain <>
-- 25/05/2014: Modified for Diaspora by Anahuac de Paula Gil -
-- 06/08/2014: Cleaned up and fixed SASL auth by Jonne Haß <>
-- 22/11/2014: Allow token authentication by Jonne Haß <>
local log = require "util.logger".init("auth_diaspora")
local new_sasl = require "util.sasl".new
daurnimator / prosody.service
Created Aug 4, 2014
systemd unit for prosody; assumes mod_systemd
View prosody.service
Description=XMPP (Jabber) Server
jhass / diaspora_spam.rb
Last active Mar 27, 2019
Deletes spam comments, posts and local spam accounts. Place into Diasporas root, edit and run. Don't forget to set necessary environment variables.
View diaspora_spam.rb
#!/usr/bin/env ruby
# List of spam accounts
spam_accounts = %w(spamacc@podA spamacc@podB spamacc@mypod)
# Delete comments even if spammer isn't a local user or spam isn't on a
# local users account.
# And delete posts of users in spam_accounts that aren't local.
always_delete = true
acook / BinaryDataHandling.markdown
Last active Dec 23, 2015
List of gems useful for parsing/generating binary data from Ruby.
View BinaryDataHandling.markdown

Binary Data

It can be challenging to use Ruby for handling raw binary data, involving a lot of Array#pack and String#unpack with the possibility of String#ord and Numeric#chr for good measure. Some of these tools might make the job a bit easier, allowing your to define schemas of the binary data and how to parse it, or even just allowing your to specify the format in a more verbose way.



You can’t perform that action at this time.