This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/shayne/go-wsl2-host is needed for this | |
# a powershell command to setup the wslhost after you started the first wsl shell after a pc startup | |
# this will help you update the hosts file with the wsl's ip address | |
# it's kind of a workaround for a situation where you don't want to run wsl2-host app as a service | |
function setup-wslhost { | |
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID) | |
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator | |
if ($myWindowsPrincipal.IsInRole($adminRole)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# powershell profile for oh-my-posh if you install it with winget, otherwise you need to import the oh-my-posh module | |
Import-Module posh-git | |
$ohmyposhversion = $(oh-my-posh --version) | |
$ohmyposhthemepath = "~/.oh-my-posh/themes/agnoster/v$ohmyposhversion" | |
# download a theme if not yet downloaded | |
if ((test-path $ohmyposhthemepath) -ne $true) { | |
new-item -itemType Directory -force -path $ohmyposhthemepath | |
$dwlurl = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$ohmyposhversion/themes/agnoster.omp.json" | |
$themeFilePath = join-path -path $ohmyposhthemepath -childpath "agnoster.omp.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div v-on-clickaway="clickAway"> | |
<input type="text" class="form-control" | |
:value="value" | |
@focus="onFocus" | |
@input="onInput" | |
@keydown.enter.prevent="enter" | |
@keydown.down.prevent="down" | |
@keydown.up.prevent="up" | |
@keydown.tab="clickAway" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function IfTrue($a, $b, $c) { if ($a) { $b } else { $c } } | |
function Coalesce($a, $b) { if ($a -ne $null) { $a } else { $b } } | |
New-Alias "??" Coalesce | |
New-Alias "?:" IfTrue | |
function py-avenv { | |
param ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public enum VKeys | |
{ | |
KEY_0 = 0x30, //0 key | |
KEY_1 = 0x31, //1 key | |
KEY_2 = 0x32, //2 key | |
KEY_3 = 0x33, //3 key | |
KEY_4 = 0x34, //4 key | |
KEY_5 = 0x35, //5 key | |
KEY_6 = 0x36, //6 key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import codecs | |
def read_block(f): | |
block_size = 0 | |
index = int.from_bytes(bytes(f.read(4)), byteorder='little') | |
block_size += 4 | |
len1 = int.from_bytes(bytes(f.read(2)), byteorder='little') | |
block_size += 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
012640BC PUSH SoulWork.01C79544 ASCII "tb_Achievement" | |
01264666 PUSH SoulWork.01C79558 ASCII "tb_Achievement_begin" | |
0126478C PUSH SoulWork.01C79570 ASCII "tb_Achievement_Emblem" | |
01264AAC PUSH SoulWork.01C79588 ASCII "tb_Achievement_Script" | |
01264C66 PUSH SoulWork.01C795A0 ASCII "tb_Akashic_Disassemble" | |
01264DA6 PUSH SoulWork.01C795B8 ASCII "tb_Akashic_Make" | |
01264F0C PUSH SoulWork.01C795C8 ASCII "tb_Akashic_Parts" | |
012651DC PUSH SoulWork.01C795DC ASCII "tb_Akashic_Records" | |
0126587C PUSH SoulWork.01C795F0 ASCII "tb_Appearance" | |
01265AF6 PUSH SoulWork.01C79600 ASCII "tb_Aura" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Soul Worker Wireshark Dissector rev 1 | |
-- Written by WRS/x1nixmzeng (forum.xentax.com) | |
-- Usage: wireshark.exe -X lua_script:ws_soulworker.lua | |
local sw_port = 27017 | |
sw_proto = Proto("sw_proto","Soul Worker Protocol") | |
local sw_method = | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// this gist about an issue with the razer synapse: Usually after windows update it doesn't come up ever again when you double | |
/// click on its icon. Also all the macros and key bindings stop working. | |
/// The invisible exception's stack trace is the following: | |
2016-01-04 19:05:33,575 [SynpaseMain::26620] DEBUG Razer.Emily.UI.SynapseApp [(null)] - DeviceMgr::Start | |
2016-01-04 19:05:33,580 [SynpaseMain::26620] DEBUG Razer.Emily.UI.AppEntryPoint [(null)] - SynapseMain::Failed | |
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {7CC0C4B6-B68F-4141-9023-E3A189EDE86D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). | |
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) | |
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipChe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void MergeWith(this AbstractApplicationContext targetContext, | |
AbstractApplicationContext sourceContext) | |
{ | |
Check.NotNull(sourceContext, "sourceContext"); | |
targetContext.Stop(); | |
foreach (var definitionName in sourceContext.GetObjectDefinitionNames()) | |
{ | |
var definition = sourceContext.GetObjectDefinition(definitionName); | |
targetContext.RegisterObjectDefinition(definitionName, definition); |
NewerOlder