Skip to content

Instantly share code, notes, and snippets.

View Hylian's full-sized avatar

Edward Shin Hylian

View GitHub Profile
@kadamski
kadamski / sds011
Last active March 31, 2024 02:03
SDS011 dust sensor reading
#!/usr/bin/python
# coding=utf-8
# "DATASHEET": http://cl.ly/ekot
from __future__ import print_function
import serial, struct, sys, time
DEBUG = 1
CMD_MODE = 2
CMD_QUERY_DATA = 4
CMD_DEVICE_ID = 5
@sardemff7
sardemff7 / pinentry-rofi.rb
Last active July 31, 2023 15:09
Pinentry rofi-based bare implementation
#! /usr/bin/env ruby
# Copyright © 2016 Quentin "Sardem FF7" Glidic
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@Hylian
Hylian / acsl_rummy.py
Last active January 13, 2020 15:12
my greatest creation
from itertools import *
from operator import *
convertValue, convertHouse = {'A': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, 'T': 10, 'J': 11, 'Q': 12, 'K': 13}, {'D': 0, 'C': 1, 'H': 2, 'S': 3}
def addcard(n, h):
if len(h) <= 1 and filter(lambda x: x[0] != 0, h) == 0: h.append((0, n))
else:
for c in h:
if c[0] == 2 and c[1][0][1] == n[1] and (convertValue[c[1][0][0]] == convertValue[n[0]]+1 or convertValue[c[1][2][0]] == convertValue[n[0]]-1):
h.append((3, c[1] + [n]))
h.remove(c)
@cryzed
cryzed / fix-infinality.md
Last active August 31, 2024 13:05
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@aurorabbit
aurorabbit / README.md
Created April 2, 2018 07:14
iPhone favourite sync

Sync your favourited photos from your iOS device

Dependencies

brew.sh

brew install libimobiledevice
brew cask install osxfuse
brew install ifuse
@kesyog
kesyog / embedded-rust-notes.md
Last active January 27, 2021 21:24
Rust embedded notes

Rust embedded notes

A place to jot down useful notes. Most if not all of this was lifted from the linked references, but I'm copying some of the highlights down here for my own reference.

Glossary

  • peripheral access crate (PAC): device crate (e.g. stm32f4) created using the svd2rust crate that presents an API to access a particular microcontroller's registers
  • hardware abstraction library (HAL) crate: higher-level abstraction on top of the PAC. This follows
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active November 11, 2024 20:23
Make Firefox fast again