Skip to content

Instantly share code, notes, and snippets.

View carstene1ns's full-sized avatar

Carsten Teibes carstene1ns

View GitHub Profile
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
module Cinch
module Plugins
class PluginManagement
include Cinch::Plugin
match(/plugin load (\S+)(?: (\S+))?/, method: :load_plugin)
match(/plugin unload (\S+)/, method: :unload_plugin)
match(/plugin reload (\S+)(?: (\S+))?/, method: :reload_plugin)
match(/plugin set (\S+) (\S+) (.+)$/, method: :set_option)
def load_plugin(m, plugin, mapping)
@armornick
armornick / playwav.c
Created August 24, 2012 07:31
Play a sound with SDL2 (no SDL_Mixer)
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played
@nicolashery
nicolashery / solarized-dark.css
Last active March 25, 2022 08:38 — forked from scotu/solarized.css
Solarized theme stylesheets for Jekyll and Pygments
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@artheus
artheus / py3lock.py
Created September 28, 2016 10:36
Small change to Gist made by https://gist.github.com/Airblader
#!/usr/bin/python
import os
import xcb
from xcb.xproto import *
from PIL import Image, ImageFilter
XCB_MAP_STATE_VIEWABLE = 2
def screenshot():
@LiquidFenrir
LiquidFenrir / gist:d110f3e7755ffbe82672eda49ae21af2
Last active August 9, 2024 16:56
gdb 101 for 3ds, credits to Stary
1. enable debugger in rosalina menu
go to process list
select a process
2. launch arm-none-eabi-gdb <path to elf>
command "target remote ip:port"
3. command "continue" or "c" to resume execution
4.
@pulsejet
pulsejet / mkxp_mruby.md
Last active May 5, 2018 06:33
Guide for mkxp with mruby

mkxp + mruby = ❤

RGSS Script Changes

Language differences

Replace all instances of

begin
    statement
end until condition

with

@loopj
loopj / wii_clang_rules
Last active October 12, 2021 20:01
devkitPPC rules for building apps with Clang
#---------------------------------------------------------------------------------
# devkitPPC rules for building with Clang
#
# How to use:
# - Copy this file into your DEVKITPPC path:
# cp wii_clang_rules $DEVKITPPC
#
# - Link Clang into your DEVKITPPC path:
# ln -s `which clang` $DEVKITPPC/bin/powerpc-eabi-clang
#
@palant
palant / README.md
Last active October 2, 2024 12:17
DKIM signing and verification filters for OpenSMTPD

Important

Current version of this code has moved into a proper GitHub repository: https://github.com/palant/opensmtpd-filters

The OpenSMTPD documentation currently suggests using either opensmtpd-filter-dkimsign or opensmtpd-filter-rspamd for DKIM support. The former lacks functionality and requires you to compile code from some Austrian web server yourself. The latter is overdimensioned for my needs. So I’ve written my own fairly simple filters in Python.

Prerequisites

These filters require Python 3 with dkimpy module installed. You can optionally install pyspf module as well, if you want dkimverify.py to perform SPF verification as well.

Setting up