Skip to content

Instantly share code, notes, and snippets.

@YetFix
YetFix / bits-stdc++.h
Last active April 24, 2024 14:15 — forked from Einstrasse/bits-stdc++.h
bits/stdc++.h header file
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@dedsm
dedsm / timescale--db--backend--base.py
Last active April 24, 2024 14:15
WeRiot Django Timescale integration
import logging
from django.contrib.gis.db.backends.postgis.base import \
DatabaseWrapper as PostgisDBWrapper
from django.db import ProgrammingError
from .schema import TimescaleSchemaEditor
logger = logging.getLogger(__name__)
@josephbadow
josephbadow / install-fireflyiii-rpi3-docker-docker-compose-ssl.md
Created September 23, 2019 10:13
Install Firefly on a Raspberry Pi 3 with Docker, Docker Compose and a self-signed certificate

I'm running a dockerized Firefly III on a Raspberry 3 in my local network. With the help of an additional nginx Container and a self-signed SSL Certificate I was able to set up https.

Maybe somebody will find this guide helpfull, it took me a couple of tries to get it right.

Install Docker on the Raspberry

Simply follow the official documentation at https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-convenience-script. You'll need to run the script if you are using the default Raspberry OS: Raspbian.

Install Docker Compose using Python PIP

Use Pythons package manager PIP to install Docker Compose, details can be found on docker.com as well: https://docs.docker.com/compose/install/#install-using-pip. Before you can follow the guide you'll need to install python-pip.

@arbourd
arbourd / invert.md
Created May 9, 2017 23:12
Invert Windows 10 mouse scroll wheel
  1. Open Powershell as an administrator
  2. Run
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
  3. Verify that all mice devices have had their FlipFlopWheel attributes set to 1
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
  4. Reboot
@robschmuecker
robschmuecker / README.md
Last active April 24, 2024 14:12
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 24, 2024 14:11
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

global class CalculateBusinessHoursDiff {
global class request
{
@InvocableVariable(label='Business Hours Id' required = true)
global String businessHoursId;
@InvocableVariable(label='Start Date' required = true)
global DateTime startDate;
@InvocableVariable(label='End Date' required = true)
global DateTime endDate;
}
@thesamesam
thesamesam / xz-backdoor.md
Last active April 24, 2024 14:07
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@IonBazan
IonBazan / flag.php
Created October 22, 2021 09:27
Country code to country flag Emoji (PL -> 🇵🇱)
<?php
/**
* Converts country code (ISO 3166-1) to its emoji flag representation (PL -> 🇵🇱).
*
* This solution supports both lowercase and uppercase codes using modulo 32 .
* Since it doesn't perform any validation, you should make sure the code is a valid country code first.
*
* 0x1F1E5 is a code of character right before "REGIONAL INDICATOR SYMBOL LETTER A" (🇦).
*
@lordsarcastic
lordsarcastic / Implement OTP for Django application for multiple uses
Last active April 24, 2024 14:06
This is a generic implementation of OTP for Django applications. It can be extended to any framework or platform that uses OTP.
This is a robust implementation that is extensible for anything that requires the use of OTP. Want to use OTP to verify
a user? Check! Want to use OTP to validate an order? CHeck! Want to use OTP to reset a password? CHEck! Want to use
OTP to verify a device? CHECk! Want to use OTP to fight people? CHECK!
I used: Django (framework), Django Rest Framework (a plugin for REST API), PostgreSQL (database)
and email (for sending the otp). You can substitute any of these for whatever you want, like using Redis instead of Postgres.
While this solution is built to be used for Django, I have added comments to explain the process for developers using
other frameworks.
Legend: