Skip to content

Instantly share code, notes, and snippets.

View Kilobyte22's full-sized avatar

Stephan Henrichs Kilobyte22

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kilobyte22 on github.
  • I am kilobyte (https://keybase.io/kilobyte) on keybase.
  • I have a public key whose fingerprint is 2F75 B61F 7F77 B92D 507C 07FC B3AC 4F40 BC39 6055

To claim this, I am signing this object:

@Kilobyte22
Kilobyte22 / ping.pl
Last active December 11, 2015 11:51
#!/bin/perl
# i3blocks script to display current ping
# Licensed under the MIT license
use strict;
use warnings;
sub ping {
my $host = shift;
/*
Note that i am quite a groovy noob (this is pretty much my first project). So don't be harsh with me :) tell me what i can improve instead
*/
class Server {
private ServerSocket server;
String tarip;
int tarport;
def Server(int port, String tarip, int tarport) {
@Kilobyte22
Kilobyte22 / tinychat.rb
Last active December 25, 2015 19:09
My Tinychat weechat script
def weechat_init
Weechat.register('tinychat', 'Kilobyte', '1.0', 'GPL3', 'Adds small chat windows for channels. Intended mainly ad widget for small split screen windows', 'gtfo', '')
Weechat.hook_command("tinychat", "manages tinychat windows", "[make] || [setmainwindow]", '', "make %(irc_channels)", "cmd_tinychat", '')
Weechat.hook_print("", "", "", 0, "hook_print", "")
Weechat::WEECHAT_RC_OK
end
def gtfo
jakimfett | (I do admit, the first time I plugged my Microsoft keyboard into my Mac which is running linux, I sorta expected *something* to esplode horribly)
=begin
Script to upload screenshots one a press of a button
warning: for this script you need the 'ruby-dbus' gem, also, this will most likely never work on Windows or OSX. Its written for linux after all. By default it utilizes KDE tools. i'll happily add more if requested.
LICENSE: GPL
=end
CFGNAME = "#{Dir.home}/.uploadscreenshot.yml"
require 'dbus'
user:
someone: NOPE
group:
somegroup: YOU GUYS ALL SUCK
#default: uncomment this to set a default message
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
void usage() {
printf("Usage: environment command [arguments]\n");
exit(1);
}
int main(int argc, char **argv) {
1. You lose the game by thinking about it
2. When you lose the game you have to publically announce it making everyone around you lose it as well
3. After losing the game you have 30 minutes to forget it again
4. By knowing these rules you are automatically participating
Congratulations, you just lost the game
@Kilobyte22
Kilobyte22 / core.rs
Last active August 4, 2017 22:11
Proof of Concept Plugin system for rust
extern crate libloading as lib;
extern crate libplugin as plugin;
use plugin::Plugin;
fn main() {
let lib = lib::Library::new("plugins/libtestplugin.so").unwrap();
unsafe {
let func: lib::Symbol<unsafe fn() -> Box<Plugin>> = lib.get(b"gimme_pluginz\0").unwrap();
let plugin: Box<Plugin> = func();