Skip to content

Instantly share code, notes, and snippets.

@rdenadai
rdenadai / python_expert_path.md
Last active April 19, 2024 20:12
My take into build a basic structure to dictate how to become a Python Expert ... from basic to specialist ?

Python Expert Path

Beginner

  • Basic syntax
    • Variables types:
      • bool, int, float, str, byte, complex, None
    • Conditionals:
      • if, else, elif, for, while, match
  • Functions: simple use, and known what first class citizen is (concept)
@bmaupin
bmaupin / free-database-hosting.md
Last active April 19, 2024 20:08
Free database hosting
@0atman
0atman / configuration.nix
Last active April 19, 2024 20:06
A rebuild script that commits on a successful build
{
config,
pkgs,
options,
...
}: let
hostname = "oatman-pc"; # to alllow per-machine config
in {
networking.hostName = hostname;
@mackmm145
mackmm145 / extension-jump-anchor.js
Created January 16, 2022 22:14
TipTap jump anchor example
import { Mark, mergeAttributes } from '@tiptap/core'
export const jumpAnchor = Mark.create( {
name: "jumpAnchor",
addAttributes() {
return {
id: {
default: null,
parseHTML: element => element.getAttribute( 'id' ),
@zloedi
zloedi / roguelike_FOV.c
Last active April 19, 2024 20:02
Efficient roguelike grid FOV / shadowcasting / line of sight in a single C function inspired by https://docs.microsoft.com/en-us/archive/blogs/ericlippert/shadowcasting-in-c-part-one
// Copyright (c) 2021 Stoiko Todorov
// This work is licensed under the terms of the MIT license.
// For a copy, see https://opensource.org/licenses/MIT.
// What this function does:
// Rasterizes a single Field Of View octant on a grid, similar to the way
// field of view / line of sight / shadowcasting is implemented in some
// roguelikes.
// Uses rays to define visible volumes instead of tracing lines from origin
// to pixels.
@realvjy
realvjy / ChoasLinesShader.metal
Last active April 19, 2024 20:01
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@alexkates
alexkates / how-to-trigger-lambda-from-sqs-stack.ts
Last active April 19, 2024 20:00
How to Trigger an AWS Lambda from SQS using the AWS CDK
// Import aws-cdk packages
import * as cdk from '@aws-cdk/core';
import * as sqs from '@aws-cdk/aws-sqs';
import * as lambda from '@aws-cdk/aws-lambda';
import * as lambdaEventSources from '@aws-cdk/aws-lambda-event-sources';
export class HowToTriggerLambdaFromSqsStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
@rkeithhill
rkeithhill / Optimize-PSReadlineHistory.ps1
Last active April 19, 2024 20:00
Removes duplicate and optionally short commands from your PSReadline history file
<#
.SYNOPSIS
Optimizes your PSReadline history save file.
.DESCRIPTION
Optimizes your PSReadline history save file by removing duplicate
entries and optionally removing commands that are not longer than
a minimum length
.EXAMPLE
C:\PS> Optimize-PSReadlineHistory
Removes all the duplicate commands.
@qoomon
qoomon / conventional_commit_messages.md
Last active April 19, 2024 20:00
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@siresorose
siresorose / currency-format-input-field.markdown
Created March 29, 2023 22:43
Currency Format Input Field

Currency Format Input Field

Auto format currency input field with commas and decimals if needed. This is how I would personally expect one to work. Works left to right without forcing user to enter 00 cents if there is none. Text is automatically formatted with commas and cursor is placed back where user left off after formatting vs cursor moving to the end of the input. Validation is on KeyUp and a final validation is done on blur.

A Pen by Wade Williams on CodePen.

License.