Skip to content

Instantly share code, notes, and snippets.

@SKempin
SKempin / Git Subtree basics.md
Last active May 6, 2024 14:55
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@yasirkula
yasirkula / SceneViewUIObjectPickerContextWindow.cs
Last active May 6, 2024 14:55
Select the UI object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2021_2_OR_NEWER
using PrefabStage = UnityEditor.SceneManagement.PrefabStage;
using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
@riipandi
riipandi / squid-plus-mikrotik.txt
Created March 11, 2012 11:02
Squid Proxy & Mikrotik Setup Script
http://ictsentani.org/?p=258
http://opensource.telkomspeedy.com/forum/viewtopic.php?pid=122506
#-------------------------------------------------------------------------------
E1 Modem1 : 192.168.77.1 -> IP Modem1 : 192.168.77.2
E2 Server : 192.168.88.1 -> IP Server : 192.168.88.2
E3 Hotspot : 192.168.99.1 -> IP Hotspot : 192.168.99.10 - 192.168.99.250
E4 Labkom : 10.10.10.254 -> IP Labkom : 10.10.10.1 - 10.10.10.20
#-------------------------------------------------------------------------------
@mholt
mholt / main.go
Created October 16, 2018 14:25 — forked from KatelynHaworth/main.go
Example of run an interactive process on the current user from system service on windows (Golang)
package main
import (
"github.com/kardianos/service"
"log"
"flag"
)
type Service struct {}
@Ninja-Koala
Ninja-Koala / svg-to-shadertoy.py
Last active May 6, 2024 14:53
Convert a svg path to a shadertoy shader
#!/usr/bin/python3
import os
import sys
import numpy as np
def read_value(string, index):
#go to the beginning of the value
while svg_content[index] not in numerals:
index+=1
#read in the value
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 6, 2024 14:52
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
ffmpeg -re -listen 1 -i rtmp://127.0.0.1:1935 -y -filter:v fps=3 -an -sn -fps_mode drop -f image2pipe -
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 6, 2024 14:52
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@antonioanerao
antonioanerao / docker-ip.sh
Created May 6, 2024 14:45
Lista os IPs dos containers docker
#!/bin/bash
docker ps --format "{{.Names}}" | while read container; do
ip=$(docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container")
printf "%-40.40s\t%s\t%s\n" "$container" "$ip"
done