Skip to content

Instantly share code, notes, and snippets.

@ercoppa
ercoppa / 80-keychron.rules
Last active February 25, 2023 18:30
K2 Keychron Ubuntu 18.04
SUBSYSTEMS=="input", ATTRS{name}=="Keychron K2", RUN+="/bin/sh -c 'echo 0 > /sys/module/hid_apple/parameters/fnmode'"
@sng2c
sng2c / lang.pl
Last active December 27, 2018 15:00
간단한 사칙연산 언어 인터프리터
use Test::More;
use Data::Dump;
sub compile {
my @assm;
my $prg = shift;
my ( $func, @args ) = @{$prg};
foreach my $a (@args) {
if ( ref($a) ne 'ARRAY' ) {
push( @assm, [ "push", $a ] );
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active June 13, 2024 06:34
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
diff --git a/zathura/callbacks.c b/zathura/callbacks.c
index 7db22f8..a8db4ed 100644
--- a/zathura/callbacks.c
+++ b/zathura/callbacks.c
@@ -254,7 +254,10 @@ cb_page_layout_value_changed(girara_session_t* session, const char* name, girara
unsigned int page_padding = 1;
girara_setting_get(zathura->ui.session, "page-padding", &page_padding);
- page_widget_set_mode(zathura, page_padding, pages_per_row, first_page_column);
+ bool page_right_to_left = false;
@Tekki
Tekki / mojo-vue.pl
Last active April 26, 2021 16:24
Mojolicious - Vue.js Example
#!/usr/bin/env perl
use Mojolicious::Lite -signatures;
get '/' => sub ($c) {
$c->render(template => 'index');
};
get '/api/:region' => sub ($c) {
my %regions = (
@Siva-Charan
Siva-Charan / Docker-find-dependent-child-image.md
Last active October 9, 2022 11:18
Docker: How to find the dependent child images?

Find the dependent child images on Docker

When you try to remove the docker image with the following command

docker rmi 6795374be8c1

Sometimes you might be facing below error:

Error response from daemon: conflict: unable to delete 6795374be8c1 (cannot be forced) - image has dependent child images

Below is the Docker command line used to find the dependent child images

@subfuzion
subfuzion / curl.md
Last active June 14, 2024 20:32
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@gbaman
gbaman / HowToOTG.md
Last active June 13, 2024 13:09
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@xero
xero / irc.md
Last active June 2, 2024 03:36
irc cheat sheet

IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
  • Leaves the specified channel.
@calid
calid / 00-preamble.md
Last active October 3, 2022 10:45
ZeroMQ Perl Performance Comparison: FFI vs XS bindings

ØMQ Perl Performance Comparison: FFI vs XS bindings

Comparison of the performance of FFI vs XS zeromq bindings. For FFI the ZMQ::FFI bindings are used, first using FFI::Raw on the backend and then using FFI::Platypus. For XS ZMQ::LibZMQ3 is used.

Comparison is done using the zeromq weather station example, first by timing wuclient.pl using the various implementations, and then by profiling wuserver.pl using Devel::NYTProf. When profiling the server is changed to simply publish 1 million messages and exit.