Skip to content

Instantly share code, notes, and snippets.

@kelvintaywl
kelvintaywl / split.py
Last active May 9, 2024 11:39
Python Script to split CSV files into smaller files based on number of lines
import csv
import sys
import os
# example usage: python split.py example.csv 200
# above command would split the `example.csv` into smaller CSV files of 200 rows each (with header included)
# if example.csv has 401 rows for instance, this creates 3 files in same directory:
# - `example_1.csv` (row 1 - 200)
# - `example_2.csv` (row 201 - 400)
# - `example_3.csv` (row 401)
@SomajitDey
SomajitDey / freemium_port_forwarding_services.md
Last active May 9, 2024 11:38
A list of free or freemium services for exposing localhost to internet with a public ip
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 9, 2024 11:36
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);
@jmausolf
jmausolf / create_delete_branch.md
Created February 7, 2018 20:53
Create new git branch from terminal

Add new branch

git checkout -b [branch_name]
#add and commit new files
git push -u origin [branch_name]

Add remote upstream for branch

git push --set-upstream origin [branch_name]
@ThePixelbrain
ThePixelbrain / ultimate-fix.md
Created May 15, 2023 20:53
[FTB Ultimate] Fix crash with recent Java 8 versions

The original FTB Ultimate for MC 1.4.7 crashes during startup with new versions of Java. This applies to any 1.4.7 modpack including Forestry or Railcraft. A crash might look like the following:

[SEVERE] [Railcraft] The mod Railcraft is expecting signature a0c255ac501b2749537d5824bb0f0588bf0320fa for source railcraft.jar, however there is no signature matching that description
[SEVERE] [Railcraft] Tampering Detected. Please re-download Railcraft.

Solution:

  1. Download this file, name it java.security and save it in the instances base folder (the .minecraft folder)
  2. Add the following Java argument to your game: -Djava.security.properties=java.security
@DilanLivera
DilanLivera / how_to_fix_failed_to_register_url_x_for_site_x_application_in_visual_studio.md
Last active May 9, 2024 11:29
How to fix Failed to register URL "X" for site "X" application "/" in Visual Studio

How to fix Failed to register URL "X" for site "X" application "/" in Visual Studio

Context

In Visual Studio, upon starting a web application with/without debugging sometimes you get the following error message in the output window

Failed to register URL "X" for site "X" application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020).

How to fix

@alpeb
alpeb / flat-network.sh
Last active May 9, 2024 11:26
2 k3d clusters with 3 nodes each, using the same flat network
#!/usr/bin/env bash
zones=(a b c)
cluster_cidr() {
echo "apiVersion: networking.k8s.io/v1alpha1
kind: ClusterCIDR
metadata:
name: new-cidr
spec:
@m-jovanovic
m-jovanovic / .editorconfig
Created June 7, 2023 12:17
Sample editor config with a bunch of rules turned off 😅
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
@kurahaupo
kurahaupo / TrueColour.md
Last active May 9, 2024 11:25 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 million)
@Normal-Tangerine8609
Normal-Tangerine8609 / progress-circle.js
Last active May 9, 2024 11:22
This is a function that allows you to create simple circular progress bars for widgets. It creates the image of the progress circle using `WebView` and the canvas element. The image is then set to the background image of a stack with padding applied so you can put any widget element within the circle.
/*
* progressCircle(on: Stack or Widget, value: number, colour: string, background: string, size: number, barWidth: number) : Promise<Stack>
*
* PARAMS
* on - the stack or widget to add the progress circle to
* value - a number between 1 and 100 to be the circle percentage or a number between 0 and 1 to be the circle percentage
* colour - a HTML supported (hex, rgb, hsl) colour for the progress of the circle. Alternitively, it can be two HTML supported colours seperated by a hyphen (white-black) for the first colour to be active on light mode and second on dark mode
* background - a HTML supported (hex, rgb, hsl) colour for the unfilled progress of the circle. Alternitively, it can be two HTML supported colours seperated by a hyphen (white-black) for the first colour to be active on light mode and second on dark mode
* size - the size of the progress circle
* barWidth - the width of the circular progress bar