Skip to content

Instantly share code, notes, and snippets.

@ethanedits
ethanedits / Render.cs
Created July 13, 2021 06:36
Render Class for GUI methods in Unity
using System;
using UnityEngine;
public class Render : MonoBehaviour
{
public static GUIStyle StringStyle { get; set; } = new GUIStyle(GUI.skin.label);
public static Color Color
{
get { return GUI.color; }
@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 10:07
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@sharunkumar
sharunkumar / adbremote.bat
Last active March 28, 2024 10:06
Windows wrapper batch file for disabling keyboard and setting brightness before using scrcpy to connect. Settings are restores after scrcpy disconnects. Based on script by Volodymyr Shymanskyy. https://gist.github.com/vshymanskyy/a44ff7af2848653e91f269910cb9d50f
@echo off
rem Requires Null Keyboard https://play.google.com/store/apps/details?id=com.wparam.nullkeyboard
rem Author: Sharun Kumar
setlocal ENABLEDELAYEDEXPANSION
for /F %%i in ('adb shell settings get system screen_brightness') do set brightness=%%i
for /F %%i in ('adb shell settings get secure default_input_method') do set ime=%%i
for /F "tokens=1,2,3,4,5,6,7,8" %%G in ('adb shell media volume --get') do (
set vol=%%J
@lukas-h
lukas-h / license-badges.md
Last active March 28, 2024 10:06
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@danielpunkass
danielpunkass / RSDimensionHuggingTextField.swift
Last active March 28, 2024 10:05
NSTextField subclasses that grow/shrink their width or height to fit text content
//
// RSDimensionHuggingTextField.swift
// RSUIKit
//
// Created by Daniel Jalkut on 6/13/18.
//
import Cocoa
// You probably want to use one of RSHeightHuggingTextField or RSWidthHuggingTextField, below
@MeLlamoPablo
MeLlamoPablo / nvmlink
Created February 1, 2017 11:34
Creates a symlink to /usr/bin/node after using nvm
@ipbastola
ipbastola / jq to filter by value.md
Last active March 28, 2024 10:04
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)