Skip to content

Instantly share code, notes, and snippets.

@SaahilClaypool
SaahilClaypool / DapperConstructorSourceGenerator.cs
Created May 31, 2023 19:31
Dapper constructor source generator
global using Microsoft.CodeAnalysis;
global using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Diagnostics;
namespace Srcgen;
/// <summary>
/// Author: Saahil Claypool
/// https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.md
@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active July 17, 2024 08:09
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01
this video was created earlier in january from a stupid idea and was driven by sheer determination
despite lacking programming skill. here's a decent description of how it was made (because i am
too lazy to write a github readme):
1. the video
i downloaded the pv off youtube and used ffmpeg to resize it down to 70x54 dimensions (for easy
math calculations, i used 27 firefox windows, 7 tabs each, so it divided nicely). i then used
ffmpeg (again) to splice the source video into 15-second segments to reduce desyncing and cpu load.
2. the frames
@NarutoVegeta
NarutoVegeta / PY0101EN-2-1-Tuples.ipynb
Created August 6, 2020 07:26
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active July 17, 2024 15:27
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@fracek
fracek / CMakeLists.txt
Last active June 22, 2024 21:33
CMake and GTK+ 3
# Thanks to @danger89 and @Ilothar for updating the gist.
# Set the name and the supported language of the project
project(hello-world C CXX)
# Set the minimum version of cmake required to build this project
cmake_minimum_required(VERSION 3.10)
# Use the package PkgConfig to detect GTK+ headers/library files
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtkmm-3.0)