Skip to content

Instantly share code, notes, and snippets.

View chudur-budur's full-sized avatar
🏠
Working from home

chudur-budur chudur-budur

🏠
Working from home
  • Intel Corporation
  • Kazla, Rajshahi, Bangladesh
View GitHub Profile
@adambard
adambard / stupid_tricks.matlab
Created May 3, 2012 23:23
Stupid MATLAB Tricks.
function stupid_tricks
% I made some functional tools for MATLAB.
assert(reduce_(@(x, y) x + y, [1, 2, 3, 4]) == 10)
% They got a little out of hand.
join = @(sep, args) ...
if_(ischar(sep), @() ... % Input check
reduce_(@(x, y) [x sep y], ... % Reduce to string
map_(@num2str, args))); % Convert args to string.
@pallas
pallas / minkowski_distance.cc
Last active July 11, 2024 20:45
Minkowski distance function
// All rights reserved,
// Derrick Pallas
// License: zlib
#include <cmath>
#include <cstdlib>
#include <limits>
#include <vector>
template <typename fp_type>
@hadess
hadess / tmp.c
Created October 5, 2013 23:19
Hack to control the keyboard backlight level on a Thinkpad Lenovo X1 Carbon Touch
/* gcc -o tmp `pkg-config --libs --cflags glib-2.0` tmp.c
*
* # modprobe ec_sys
*
* # watch -n 0.1 hexdump -C /sys/kernel/debug/ec/ec0/io
*
* 00000000 a7 05 a0 e2 00 86 05 00 00 00 47 00 00 03 00 10 |..........G.....|
* 00000000 a7 05 a0 e2 00 86 05 00 00 00 47 00 00 43 00 10 |..........G..C..|
* 00000000 a7 05 a0 e2 00 86 05 00 00 00 47 00 00 83 00 10 |..........G.....|
@lambdalisue
lambdalisue / README.markdown
Last active October 28, 2023 18:12
n-dimensional hyperplane (line for 2D, plane for 3D) fitting via singular value decomposition method

n-dimensional hyperplane (line for 2D, plane for 3D) fitting via singular value decomposition method

Screenshot

@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@pauloromeira
pauloromeira / tlp
Last active May 12, 2024 21:36
My TLP config file (/etc/default/tlp) for ThinkPad
# ------------------------------------------------------------------------------
# tlp - Parameters for power saving
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
# dir: /etc/default/tlp
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.