Skip to content

Instantly share code, notes, and snippets.

@BBArikL
BBArikL / wallpaper-engine-kde-plugin.nix
Last active April 11, 2025 01:15
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 January 10, 2025 15:31
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 April 10, 2025 12:28
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:

@borlaym
borlaym / animals.json
Created December 15, 2014 13:38
Array of animal names
[
"Aardvark",
"Albatross",
"Alligator",
"Alpaca",
"Ant",
"Anteater",
"Antelope",
"Ape",
"Armadillo",