Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Scrollbar Windows 95 Style</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
@dhh
dhh / linux-setup.sh
Last active May 19, 2024 06:08
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl btop \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@s4y
s4y / lasercube.py
Last active May 19, 2024 06:08
LaserCube controller
#!/usr/bin/env python3
# This is a proof of concept for controlling a LaserCube
# (https://www.laseros.com) over the network. RUNNING THIS CODE WITH A REAL
# LASERCUBE CAN BE PHYSICALLY DANGEROUS. PLEASE BE CAREFUL, AND, IF IN DOUBT,
# USE THE SAFETY LENS!
# Copyright 2021 Sidney San Martín
#
# Permission to use, copy, modify, and/or distribute this software for any
@yushiyangk
yushiyangk / Regular expressions for Python built-in types.md
Last active May 19, 2024 06:07
Regular expressions for Python built-in types

Regular expressions for Python built-in types

bool_pattern = ".*"
int_pattern = r"[+-]?(?:[0-9]|[0-9][0-9_]*[0-9])"
float_numeric_pattern = r"[+-]?(?:[0-9]\.?|[0-9][0-9_]*[0-9]\.?|(?:[0-9]|[0-9][0-9_]*[0-9])?\.(?:[0-9]|[0-9][0-9_]*[0-9]))(?:[eE][+-](?:[0-9]|[0-9][0-9_]*[0-9]))?"
float_pattern = r"[+-]?(?:(?:[0-9]\.?|[0-9][0-9_]*[0-9]\.?|(?:[0-9]|[0-9][0-9_]*[0-9])?\.(?:[0-9]|[0-9][0-9_]*[0-9]))(?:[eE][+-](?:[0-9]|[0-9][0-9_]*[0-9]))?|[iI][nN][fF](?:[iI][nN][iI][tT][yY])?|[nN][aA][nN])"

Expanded

Useful when using python -c 'python_script' as part of a larger task/shell script.

These one-liners will exit with exit code 1 if "no" is chosen.

Reprompt for invalid inputs

Default "yes"

@ddemidov
ddemidov / Makefile
Created June 13, 2012 18:38
Hello world in OpenCL
hello: hello.cpp
g++ -std=c++0x -o hello hello.cpp -lOpenCL
@Blackshome
Blackshome / appliance-notifications.yaml
Last active May 19, 2024 06:05
appliance-notifications.yaml
blueprint:
name: Appliance Notifications & Actions
description: >
# 📳 Appliance Notifications & Actions
**Version: 2.0**
🤔 Watts your appliance up to, you're always in the know from start to finish!🛎️🔌💸
@osipxd
osipxd / !paper-versions.md
Last active May 19, 2024 06:03
Paper versions links
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Scrollbar Windows 95 Style</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Scrollbar Windows 95 Style</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;