Skip to content

Instantly share code, notes, and snippets.

View ZimM-LostPolygon's full-sized avatar

Serhii Yolkin ZimM-LostPolygon

View GitHub Profile
# author: eterna1_0blivion & soredake
# Get a link to the Registration Entries file
$link = "https://gist.github.com/eterna1-0blivion/70c1e5b14c7cfa8c6b6d574eb38fd27e/raw/context_pwsh_fix.reg"
# Install them into Registry using PowerShell
Invoke-WebRequest -Uri "$link" -OutFile "$env:TEMP/context_pwsh_fix.reg"
reg import "$env:TEMP/context_pwsh_fix.reg"
# Notify the user before exiting the program
@kpcftsz
kpcftsz / DropShadows.cpp
Last active January 6, 2024 17:52
K.I.S.S. Dear ImGui drop shadows - dead simple
/*
* This function assumes the existence of an active Dear ImGui window
*/
void RenderDropShadow(ImTextureID tex_id, float size, ImU8 opacity)
{
ImVec2 p = ImGui::GetWindowPos();
ImVec2 s = ImGui::GetWindowSize();
ImVec2 m = {p.x + s.x, p.y + s.y};
float uv0 = 0.0f; // left/top region
float uv1 = 0.333333f; // leftward/upper region
@doole
doole / wine32_macos.org
Last active April 4, 2024 21:16
Use win32 binaries on macOS 10.15/11.0

macOS wine 32/64-bit Setup

Run 32-bit apps on macOS Catalina (10.15) and Big Sur (11.0).

Installation

Dependencies

First install homebrew brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@npearce
npearce / install-docker.md
Last active May 22, 2024 10:13
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@gakonst
gakonst / EventTest.js
Last active August 21, 2018 19:21
Examples of event logging in web3.js. Take note that when used with testrpc/ganache, there are various bugs where events don't get fired or get fired twice. More here: https://github.com/trufflesuite/ganache-cli/issues/338. I also prefer using async/await instead of callbacks.
pragma solidity ^0.4.18;
contract EventTest {
event LogEventTest(uint _x);
event LogOtherEventTest(address indexed _sender);
function emitEvent(uint x) public {
LogEventTest(x);
}
@smkplus
smkplus / UnityShaderCheatSheet.md
Last active May 7, 2024 07:34
Controlling fixed function states from materials/scripts in Unity

16999105_467532653370479_4085466863356780898_n

Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
 
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
@vestrel00
vestrel00 / Dagger2SimpleExample.java
Last active October 7, 2021 19:59
A: Dagger.android 2.11 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes
// This is a super simplified example of how to use the new dagger.android framework
// introduced in Dagger 2.10. For a more complete, in-depth guide to dagger.android
// read https://proandroiddev.com/how-to-android-dagger-2-10-2-11-butterknife-mvp-part-1-eb0f6b970fd
// For a complete codebase using dagger.android 2.11-2.17, butterknife 8.7-8.8, and MVP,
// see https://github.com/vestrel00/android-dagger-butterknife-mvp
// This example works with Dagger 2.11-2.17. Starting with Dagger 2.11,
// @ContributesAndroidInjector was introduced removing the need to define @Subcomponent classes.
@doggan
doggan / CloudBundle.cs
Created June 16, 2017 19:56 — forked from chatpongs/CloudBundle.cs
Unity C# script to let Unity Cloud Build create bundles and upload them to some server
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using AssetBundles; // Require AssetBundleManager available here https://www.assetstore.unity3d.com/en/#!/content/45836
// Place this file in Editor filder
public class CloudBundle{
[PostProcessBuildAttribute(1)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {
@odinserj
odinserj / SkipWhenPreviousJobIsRunningAttribute.cs
Last active May 15, 2024 12:38
SkipWhenPreviousJobIsRunningAttribute.cs
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
@dianjuar
dianjuar / Install update WordPress puglins directly.md
Last active April 16, 2024 12:21
Install update WordPress plugins without providing ftp access

Install WordPress plugins directly (without FTP)

Put this on your wp-config.php

/* That's all, stop editing! Happy blogging. */
define('FS_METHOD', 'direct');