Skip to content

Instantly share code, notes, and snippets.

View oktomus's full-sized avatar

Kevin Masson oktomus

View GitHub Profile
@oktomus
oktomus / ScriptCompilationTime.cs
Created March 30, 2023 11:04
Monitor time taken to recompile scripts in Unity and log it
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
public static class ScriptCompilationTime
{
private const string FileName = ".AssemblyReloadStarted.txt";
private static readonly string FilePath = Path.Combine(Application.dataPath, FileName);
I am attesting that this GitHub handle oktomus is linked to the Tezos account tz1YPLHAyrv1NUy8e1tB1bz9Ewwz3waTDpnU for tzprofiles
sig:edsigtqwkME8FMhC2W8YHUGiFTCpTj1VFDcGh1V8Ld2tRrCFz1uLcqDu6ESczbJn1UYETwZFh5dC3KMTQNrkq2bK1UZp4MHYESY
@oktomus
oktomus / tell_me_the_difference.py
Last active October 23, 2020 20:41
Tell me the difference
import requests
import urllib.request
import time
from bs4 import BeautifulSoup
import difflib
import os
import smtplib
import email.message
import io
@oktomus
oktomus / MaximizeStandaloneWindow.cs
Created July 31, 2020 13:25
Maximize Unity standalone window
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using UnityEngine;
using System.Diagnostics;
/// <summary>
/// Source : https://improve.dk/minimizing-and-maximizing-windows/
/// </summary>
@oktomus
oktomus / substance_utils.py
Created July 7, 2020 06:34
Substance Designer Scripting utils
import sd
def print_selected_nodes_properties():
"""Show all inputs and outputs of a node."""
context = sd.getContext()
app = context.getSDApplication()
packageMgr = app.getPackageMgr()
uiMgr = app.getQtForPythonUIMgr()
node = uiMgr.getCurrentGraphSelection()[0]
@oktomus
oktomus / fork-custom-commands.md
Last active August 23, 2024 12:18
Fork custom commands

With custom commands, you are one shortcut away to run commands thanks to the Quick Launch (Ctrl+P, ⌘+P).

Custom commands can be configured in File > Preferences > Custom commands, or by editing the json file custom-commands.json located in AppData/Local/Fork on Windows and ~/Library/Application Support/com.DanPristupov.Fork/custom-commands.json on MacOS.

Please share your own custom commands :)

How to use

Fork commands are posted as comments on this gist. Press CTRL+F to search for commands.

@oktomus
oktomus / Makefile
Created December 14, 2018 14:58
GameBoy Hello World
GB_NAME := hello_world
all: $(GB_NAME).gb
$(GB_NAME).gb: $(GB_NAME).o
rgblink -o $@ $<
rgbfix -v -p 0 $@
$(GB_NAME).o: $(GB_NAME).ds
rgbasm -o $@ $<
@oktomus
oktomus / regex.txt
Last active November 23, 2017 20:59
Usefull regex
Duik translation files
-----------------------
DutranslatorArray.push(["Duik - Loading icons",0,"Duik - Chargement des icônes"]);
\\"([^\\"\\](?:\\.[^\\"\\])?)\\" , (\\d) , \\"([^\\"\\](?:\\.[^\\"\\])?)\\" ]\); (?:\/\/(.))*
Capture les 3 ou + paramètres entre ([ et )]
Dutranslator.languages.push(['fr','Français']);
'([^\\\\\\*\\.\\s/]+)','([^\\\\\\*\\.\\s/]+)'
Capture le code et le language name
@oktomus
oktomus / kmean.py
Created November 18, 2017 20:34
Python kmean implementation
#!/usr/bin/python
# Kmean on a CSV data set
# 2016
import sys
import csv
if len(sys.argv) < 2:
print "USAGE : %s csv-file" % (sys.argv[0])
#!/usr/bin/python
"""
Set a red alarm on a given light when the specified website is down
"""
import os
from phue import Bridge
from time import sleep