Skip to content

Instantly share code, notes, and snippets.

View apreiml's full-sized avatar
💭
Just another traveler through time and space

apreiml

💭
Just another traveler through time and space
View GitHub Profile
@apreiml
apreiml / syntax.s
Created October 11, 2021 19:08 — forked from mishurov/syntax.s
AT&T assembly syntax and IA-32 instructions
# --------
# Hardware
# --------
# Opcode - operational code
# Assebly mnemonic - abbreviation for an operation
# Instruction Code Format (IA-32)
# - Optional instruction prefix
# - Operational code
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index eb51d76e..0215e3d3 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -370,7 +370,7 @@ if ($hz eq '--can') {
}
@val = @{$canned_values{$hz}};
- if (!defined(@val)) {
+ if (!scalar(@val)) {
@apreiml
apreiml / Chapter 2.scm
Created August 17, 2018 11:32
Requires sicp plugin: # raco pkg install sicp
#lang sicp
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence) (accumulate op initial (cdr sequence)))))
(accumulate + 0 (list 1 2 3))
@apreiml
apreiml / MenuLookDemo.java
Created July 5, 2018 14:22
javac MenuLookDemo.java && java MenuLookDemo
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
@apreiml
apreiml / TextDemo.java
Created June 29, 2018 08:14
javac TextDemo.java && java TextDemo
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
#!/bin/sh
# Device id: xinput list | grep TouchPad
# Thinkpad Touchpad on T560: 11
DEVICE_ID=11
DEVICE_STATE=`xinput --list-props $DEVICE_ID | awk -F'\t' '/Device Enabled/ { print $3 }'`
if [ $DEVICE_STATE = 0 ]; then
xinput --enable $DEVICE_ID
@apreiml
apreiml / gextract.c
Created December 11, 2012 08:51
Modified miniz example to handle headerless zip files
// example3.c - Demonstrates how to use miniz.c's deflate() and inflate() functions for simple file compression.
// Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c.
// For simplicity, this example is limited to files smaller than 4GB, but this is not a limitation of miniz.c.
#include "miniz.c"
#include <limits.h>
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint;