Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>test</title>
<style>
.product {
border: 1px solid #ddd;
float: left;
width: 200px;
height: 200px;
@fre-sch
fre-sch / matrix-rain.html
Last active June 17, 2024 07:17
Matrix rain effect
<!DOCTYPE html>
<html>
<style>
html, body {
width: 100vw;
height: 100vh;
padding: 0;
margin: 0;
background: black;
}
@fre-sch
fre-sch / keys.part.h
Created May 8, 2014 07:19
Macro for ALT/LGUI/etc combination
#define KEYS__ALT(name, value) \
void P(name) (void) { KF(press)(KEYBOARD__LeftAlt); \
KF(press)(value); } \
void R(name) (void) { KF(release)(value); \
KF(release)(KEYBOARD__LeftAlt); }
#define KEYS__LGUI(name, value) \
@fre-sch
fre-sch / MultiDateFormat.groovy
Last active June 10, 2016 14:44
Parse multiple date string formats
import java.text.DateFormat
import java.text.FieldPosition
import java.text.NumberFormat
import java.text.ParsePosition
import java.text.SimpleDateFormat
class MultiDateFormat extends DateFormat {
private final SimpleDateFormat printer
private final List<SimpleDateFormat> parsers
@fre-sch
fre-sch / selection_to_layer_cropped.py
Last active January 28, 2023 10:51
Gimp Python-Fu script that copies selection to new layer and autocrops layer.
#!/usr/bin/env python
from gimpfu import *
def python_selection_to_layer_cropped(image, drawable, layer_name):
pdb.gimp_image_undo_group_start(image)
prev_layer = image.active_layer
pdb.gimp_edit_copy(image.active_layer)
fsel = pdb.gimp_edit_paste(drawable, False)
<!--
once for each <twitch-user-handle>, in this case 'time_of_chaos'.
id should be set as "shoco-twitch-channel-<twitch-user-handle>" but any unique string is fine.
data-channel must be set to <twitch-user-handle>
-->
<div class="shoco-twitch-channel"
id="shoco-twitch-channel-time_of_chaos"
data-channel="time_of_chaos"
style="display:none">
<h3><i class="shoco-twitch-channel-online shoco-twitch-channel-online-icon"></i><span class="shoco-twitch-display-name"></span></h3>
@fre-sch
fre-sch / README.md
Created June 10, 2016 14:51
Elite Dangerous Recipe Database
@fre-sch
fre-sch / components.py
Last active October 24, 2016 06:03
IOC and DI service locator container implementation
from sslib import Registry
import sys
sys.modules[__name__] = Registry()
class DQNAgent:
default_options = dict(
replay_memory_size=10000,
batch_size=12,
action_count=0,
frame_stack=None
)
def __init__(self, **kwargs):
opts = self.default_options.copy()
@fre-sch
fre-sch / app.jsx
Created March 12, 2018 06:48
preact drag and drop
import {h, Component} from "preact"
const lorem = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
class DndListItem extends Component {
render({onDragStart, children}) {
return (
<div class="dnd-list-item"
draggable="true"
onDragStart={onDragStart}>