Skip to content

Instantly share code, notes, and snippets.

View Trogious's full-sized avatar

Trog Trogious

View GitHub Profile
@aditya-r-m
aditya-r-m / crgb.cc
Created July 24, 2022 07:01
Custom Trident Z DRAM RGB Turndown
// pieces extracted & trimmed from https://gitlab.com/CalcProgrammer1/OpenRGB
#include <cstring>
#include <iostream>
#include <linux/i2c-dev.h>
#include <linux/i2c.h>
#include <sys/ioctl.h>
#include <dirent.h>
#include <fcntl.h>
@delivrance
delivrance / ainput.py
Last active April 9, 2024 11:21
Python async input
import asyncio
from concurrent.futures import ThreadPoolExecutor
async def ainput(prompt: str = "") -> str:
with ThreadPoolExecutor(1, "AsyncInput") as executor:
return await asyncio.get_event_loop().run_in_executor(executor, input, prompt)
async def main():
@dpapathanasiou
dpapathanasiou / dst.py
Created August 16, 2014 15:42
How to tell if Daylight Savings Time is in effect using Python
from datetime import datetime
import pytz
def is_dst ():
"""Determine whether or not Daylight Savings Time (DST)
is currently in effect"""
x = datetime(datetime.now().year, 1, 1, 0, 0, 0, tzinfo=pytz.timezone('US/Eastern')) # Jan 1 of this year
y = datetime.now(pytz.timezone('US/Eastern'))
@rduplain
rduplain / MainActivity.java
Created May 8, 2012 20:08
A very simple full-screen WebView activity for Android native wrappers, as a starting point.
package com.willowtreeapps.demo;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity {