Skip to content

Instantly share code, notes, and snippets.

@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
from shapely.geometry import LineString, MultiLineString, Point
from collections import deque
def split_line_string(line_string):
"""Break a LineString"""
for start, end in zip(line_string.coords[:-1], line_string.coords[1:]):
yield LineString((start, end))
@dpgraham
dpgraham / espresso-vs-appium.md
Last active May 9, 2024 11:20
Espresso vs. Appium

Espresso vs. Appium Comparison

Espresso and Appium are both automated UI testing frameworks but they work in different ways. There are use-cases where Espresso is the more suitable choice and there are use-cases where Appium is the more suitable choice.

The primary difference between the two is that Appium is a purely black box testing framework and Espresso is not black-box or white-box, but what they call a "grey box" testing framework (this will be explained further).

Appium tests the actual Android application. It takes the application apk and runs UI tests on them without access to any of the internals of the application. An Appium test knows nothing about "Activities", "Broadcast Services", "Intents", etc... The tests have the same access privileges to an application that a user has and thus the tests simulate the usage of an app the way that a user would actually use the app.

Espresso, on the other hand, is a Java framework that is installed with

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],