Skip to content

Instantly share code, notes, and snippets.

@flo-l
flo-l / ugly.json
Created June 6, 2018 18:59
Sample json
{"widget":{"debug":"on","window":{"title":"Sample Konfabulator Widget","name":"main_window","width":500,"height":500},"image":{"src":"Images/Sun.png","name":"sun1","hOffset":250,"vOffset":250,"alignment":"center"},"text":{"data":"Click Here","size":36,"style":"bold","name":"text1","hOffset":250,"vOffset":100,"alignment":"center","onMouseUp":"sun1.opacity = (sun1.opacity / 100) * 90;"}}}
@flo-l
flo-l / X11FullscreenHelper.rb
Created March 22, 2016 09:55
This is a super dumb port of [this gist](https://gist.github.com/vkravets/5370589). It should be functionally equivalent. I ported the code because I had trouble getting it to work with jruby. This is confirmed to work on Fedora 23 with jruby 9.0.4.0. All credits to the original author Vladimir Kravets.
# This is a port of [this gist](https://gist.github.com/vkravets/5370589)
# I literally copied the code and ported it line by line, so all credits belong to the author, Vladimir Kravets.
require 'java'
# I guess this is necessary..
# I'm on Fedora 23, I had to install the packages jna and jna-contrib
# on other platforms these two jar files might live in other locations
require '/usr/share/java/jna.jar'
require '/usr/share/java/jna/jna-platform.jar'
@flo-l
flo-l / main.rs
Last active September 30, 2015 15:38
#![feature(result_expect)]
#[macro_use]
extern crate clap;
extern crate image;
extern crate rustc_serialize;
use rustc_serialize::base64::ToBase64;
use rustc_serialize::hex::ToHex;
macro_rules! construct_tuple {
(0,$it:expr) => ();
($n:expr, $e:expr) => (
$e,construct_tuple!($n-1,$e)
);
}
#[test]
fn construct_tuple() {
let t = (construct_tuple!(2,1u8),);
00000000002014e0 B __bss_start
w __cxa_finalize@@GLIBC_2.2.5
00000000002014e0 D _edata
00000000002014e8 B _end
0000000000000808 T _fini
w __gmon_start__
00000000000005f0 T _init
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
w _Jv_RegisterClasses