Skip to content

Instantly share code, notes, and snippets.

@BBArikL
BBArikL / wallpaper-engine-kde-plugin.nix
Last active August 14, 2025 20:26
wallpaper-engine-kde-plugin on NixOS
{ config, lib, pkgs, ...}:
let
# References: https://github.com/xerhaxs/nixos/blob/main/nixosModules/pkgs/wallpaper-engine-kde-plugin.nix and https://discourse.nixos.org/t/wallpaper-engine-on-nixos-wallpaper-engine-kde-plugin/19744/25
glslang-submodule = with pkgs; stdenv.mkDerivation {
name = "glslang";
installPhase = ''
mkdir -p $out
'';
src = fetchFromGitHub {
@thekaushikls
thekaushikls / build_module.py
Last active June 7, 2026 08:26
compile .py to .dll
#!/usr/bin/env ipy
# -*- coding: utf-8 -*-
"""
This script collects all python scripts (.py) from the project (including sub-folders) and compiles them into a dynamic link library (.dll) file. File will be placed inside the 'bin' folder. Place this file in the root directory of a project, prior to execution.
Note:
This script uses the Common Language Runtime Library (CLR). Use IronPython for execution.
Download IronPython 2.7.9 from https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.9
@diamantidis
diamantidis / scala-ci.yml
Last active December 1, 2023 19:37
GitHub Actions for a Scala project (unit tests, code coverage, scalafmt)
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: sbt coverage test
- name: Coverage Report
run: sbt coverageReport
- name: Upload coverage to Codecov
@andrevdm
andrevdm / Lib.hs
Created September 8, 2018 08:44
Haskell MTL and classy lenses example (ReaderT, ExceptT)
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Lib where
import Protolude
import Control.Lens.TH (makeClassy, makeClassyPrisms)
@soulmachine
soulmachine / jwt-expiration.md
Last active May 3, 2026 13:29
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@nhasbun
nhasbun / .gitignore
Last active March 13, 2026 18:31
Git ignore file for quartus II projects
# Working with Altera Quartus II (Q2) and do proper versioning is not that easy
# but if you follow some rules it can be accomplished. :)
# This file should be placed into the main directory where the .qpf file is
# found. Generally Q2 throws all entities and so on in the main directory, but
# you can place all stuff also in separate folders. This approach is followed
# here. So when you create a new design create one or more folders where your
# entities will be located and put a .gitignore in there that overrides the
# ignores of this file, e.g. one single rule stating "!*" which allows now all
# type of files. When you add a MegaFunction or another entity to your design,
# simply add it to one of your private folders and Q2 will be happy and manage
@borlaym
borlaym / animals.json
Created December 15, 2014 13:38
Array of animal names
[
"Aardvark",
"Albatross",
"Alligator",
"Alpaca",
"Ant",
"Anteater",
"Antelope",
"Ape",
"Armadillo",