Skip to content

Instantly share code, notes, and snippets.

module SubstitutionCipher where
import Data.List
import Data.Maybe
chunkify :: Int -> [a] -> [[a]]
chunkify _ [] = []
chunkify n xs = hd : chunkify n tl
where
(hd, tl) = splitAt n xs
@remi6397
remi6397 / 10-evdev.conf
Created February 8, 2018 17:45
My Input Method configuration
# - - - Logitech Marble Mouse Settings - - -
#
# The Logitech Marble Mouse buttons are mapped [A-D] from left to right:
# A (large); B (small) | C (small); D (large).
#
# Preferred options for right-handed usage:
# A = normal click [1]
# B = middle-click [2]
# C = middle-click [2]
# D = right-click [3]
@remi6397
remi6397 / x2.xml
Created February 8, 2018 16:58
Manifest for Nougat ROMs on LeEco Le Max2 (x2)
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="slim-x2/android_device_leeco_x2-old" path="device/leeco/x2" remote="private" revision="ng7.1-eas" />
<project name="slim-x2/android_kernel_leeco_msm8996" path="kernel/leeco/msm8996" remote="private" revision="ng7.1" />
<project name="slim-x2/proprietary_vendor_leeco" path="vendor/leeco" remote="private" revision="android-7.1" />
<project name="LineageOS/android_device_qcom_common" path="device/qcom/common" remote="private" revision="cm-14.1" />
@remi6397
remi6397 / foo.rs
Last active December 13, 2017 13:29
let mut pressure_pen = evdev::enumerate().into_iter().find(|d| d.absolute_axes_supported().contains(ABS_PRESSURE));
let get_pressure: Box<FnMut() -> i32> = match pressure_pen {
Some(pressure_pen) => Box::new(move || -> i32 {
let mut events = pressure_pen.events_no_sync().unwrap();
// ^^^^^^^^^^^^ - cannot borrow captured outer variable in FnMut closure as mutable
let pressure = events.find(|ev| ev.code < 0xFF && 1 << ev.code == ABS_PRESSURE.bits());
match pressure {
Some(pressure) => pressure.value,
_ => 0i32
# inky.sh
# Copyright (C) 2017 remi6397
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@remi6397
remi6397 / helper.cpp
Created October 9, 2017 16:58
Simple encryption using tiny-aes
#include <stdlib.h>
#include <string>
#include "../../../../../3rdparty/tiny-AES-c/aes.h"
#define AES_BLOCK_SIZE 16
uint8_t* EncryptString(std::string input, std::string key)
{
int decryptedLength = input.size();
int keyLength = key.size()+(32-(key.size()%32));
@remi6397
remi6397 / ascii85.c
Created October 9, 2017 15:08
Ascii85
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <getopt.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
unsigned int AllocMax;
char* Data;
#0 0x00007fa211075029 in syscall () at /usr/lib/libc.so.6
#1 0x00007fa20f25322c in () at /usr/lib/libglib-2.0.so.0
#2 0x00007fa0ac1e08ad in () at /usr/lib/libgstadaptivedemux-1.0.so.0
#3 0x00007fa0ac3f741d in () at /usr/lib/gstreamer-1.0/libgsthls.so
#4 0x00007fa206a7eade in gst_element_change_state () at /usr/lib/libgstreamer-1.0.so.0
#5 0x00007fa206a7f23f in () at /usr/lib/libgstreamer-1.0.so.0
#6 0x00007fa206a5c6d8 in () at /usr/lib/libgstreamer-1.0.so.0
#7 0x00007fa0cd987c11 in () at /usr/lib/gstreamer-1.0/libgstplayback.so
#8 0x00007fa206a7eade in gst_element_change_state () at /usr/lib/libgstreamer-1.0.so.0
#9 0x00007fa206a7f23f in () at /usr/lib/libgstreamer-1.0.so.0
@remi6397
remi6397 / dasdas.yml
Created January 17, 2017 16:46
Defuse!1
package pl.jeremiaszn.defuse;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
@remi6397
remi6397 / build.gradle
Last active March 18, 2017 10:47
Gradle build for Spigot/Bukkit API
apply plugin: 'java'
apply plugin: 'maven'
group = 'xyz.myname.pluginname'
version = '1.0.0-SNAPSHOT'
archivesBaseName = 'PluginName'
// May be 1.7 (jdk7) from now
sourceCompatibility = 1.6
targetCompatibility = 1.6