Skip to content

Instantly share code, notes, and snippets.

@keplersj
keplersj / logged.rs
Created July 25, 2015 21:00
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() {
@denschub
denschub / freeze.md
Last active April 27, 2022 18:47
diaspora release announcement templates

diaspora* |VERSION| freeze

As scheduled, we froze diaspora* minor release |VERSION|. Please check the Changelog for more information on changes included in this release.

If you are running your own pod, please help us test the RC before the minor gets released next Sunday. To get the code, run git pull; git checkout release/|VERSION| on your development pod. Please be aware that this is a release candidate and, although we did careful testing, bugs may occur. Follow the usual update instructions to get your testing system updated.


Next release (|THIS_RELEASE|): |THIS_RELEASE_DATE|
Next minor freeze (|NEXT_FREEZE|): |NEXT_FREEZE_DATE|

@datanoise
datanoise / crystal-tags.cr
Last active March 5, 2021 03:24
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
jhass / RubyOnArch.md
Last active March 17, 2024 04:59
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
jhass / vmm-change-password[slash]index.php
Last active August 29, 2015 14:07
Afterlogic WebMail VMM password change plugin
<?php
/*
* Afterlogic WebMail VMM password change plugin
* Based upon http://www.afterlogic.com/wiki/Password_change_for_ISPConfig_%28WebMail_Plugins%29
* VMM: http://vmm.localdomain.org/
* WebMail lite: http://www.afterlogic.org/webmail-lite
*
* The plugin calls doveadm pw.
*
* You should create a dedicated role and add it to the mailsys role.
@skanev
skanev / rubocop.rb
Last active March 13, 2024 08:24
A Rubocop wrapper that checks only added/modified code
#!/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
jhass / mod_auth_diaspora.lua
Last active March 15, 2018 13:14
Prosody authentication for Diaspora. Tested with Prosody 0.9.4. See https://wiki.diasporafoundation.org/Integration/XMPP/Prosody
-- Based on Simple SQL Authentication module for Prosody IM
-- Copyright (C) 2011 Tomasz Sterna <tomek@xiaoka.com>
-- Copyright (C) 2011 Waqas Hussain <waqas20@gmail.com>
--
-- 25/05/2014: Modified for Diaspora by Anahuac de Paula Gil - anahuac@anahuac.eu
-- 06/08/2014: Cleaned up and fixed SASL auth by Jonne Haß <me@jhass.eu>
-- 22/11/2014: Allow token authentication by Jonne Haß <me@jhass.eu>
local log = require "util.logger".init("auth_diaspora")
local new_sasl = require "util.sasl".new
@daurnimator
daurnimator / prosody.service
Created August 4, 2014 01:55
systemd unit for prosody; assumes mod_systemd
[Unit]
Description=XMPP (Jabber) Server
After=network.target
[Service]
User=prosody
ProtectSystem=full
ProtectHome=true
Type=notify
ExecStart=/usr/bin/prosody
@jhass
jhass / diaspora_spam.rb
Last active February 14, 2022 09:43
Deletes spam comments, posts and local spam accounts. Place into Diasporas root, edit and run. Don't forget to set necessary environment variables.
#!/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