Skip to content

Instantly share code, notes, and snippets.

@lrvick
lrvick / github-troll.md
Last active April 1, 2025 08:14
Trolling Github's DMCA repo with their own security flaws.
@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active February 17, 2025 10:57
iOS Widget, das die Anzahl an Klopapier Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Klopapier Widget
//
// Copyright (C) 2020 by marco79 <[email protected]>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@popcatalin81
popcatalin81 / MyExtensions.cs
Created October 15, 2020 17:02
My Linqpad ultils
/// <summary>
/// Extensions class with enumerable extensions targeted at code generation
/// </summary>
public static class EnumerableExtensions
{
/// <summary>
/// Yields a single value
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="instance"></param>
@simonw
simonw / earthquakes-to-sqlite.ipynb
Last active July 23, 2021 10:06
Using Datasette with Jupyter to publish your data - JupyterCon 2020 - rendered here: https://nbviewer.jupyter.org/gist/simonw/656c21b5800d5e4624dec9930f00e093
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using System;
using System.Collections.Generic;
using System.Linq;
namespace [YOURNAMESPACEHERE]
{
public static class TypeExtensions
{
public static bool IsDerivingFrom(this Type type, Type searchType)
@ZacharyPatten
ZacharyPatten / ConsoleInput.md
Last active April 4, 2025 09:00
Beginner's Guide To Console Input In C#

Beginner's Guide To Console Input In C#

Note: I recommend reading this gist in order because Examples 1-6 build on each other.

@katef
katef / plot.awk
Last active November 20, 2024 23:27
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@kzu
kzu / profiles.json
Last active July 22, 2020 06:26
Windows Terminal settings
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{63661ee7-c8c4-434e-8579-f6112c77101f}",
"requestedTheme": "dark",
"profiles":
{
@katef
katef / life-utf8.c
Last active September 8, 2024 05:59
XBM to UTF-8 braille image things
/*
* John Conway's Game of Life.
*
* This is written for POSIX, using Curses. Resizing of the terminal is not
* supported.
*
* By convention in this program, x is the horizontal coordinate and y is
* vertical. There correspond to the width and height respectively.
* The current generation number is illustrated when show_generation is set.
*
@tfcporciuncula
tfcporciuncula / PdfDownloader.kt
Last active September 8, 2022 06:41
PdfDownloader.kt
class PdfDownloader @Inject constructor(
private val context: Context,
private val yourApi: YourApi
) {
private class DownloadException(message: String, cause: Throwable? = null) : RuntimeException(message, cause)
suspend fun download(url: String, fileName: String): String = withContext(Dispatchers.IO) {
val file = createFile(fileName)