This file contains hidden or 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
| use std::env; | |
| use std::io::Result; | |
| use std::process::{Command, ExitCode, Stdio}; | |
| fn main() -> Result<ExitCode> { | |
| let status = Command::new(r"C:\Program Files\Git\usr\bin\vim.exe") | |
| .args(env::args().skip(1)) | |
| .stdin(Stdio::inherit()) | |
| .stdout(Stdio::inherit()) | |
| .stderr(Stdio::inherit()) |
This file contains hidden or 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
| New-ItemProperty ` | |
| -Path 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -PropertyType Binary ` | |
| -Value 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| Restart-Computer |
This file contains hidden or 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 Cocoa | |
| XTERM_256_COLORS: list[str] = [ | |
| "000000", | |
| "800000", | |
| "008000", | |
| "808000", | |
| "000080", | |
| "800080", | |
| "008080", |
This file contains hidden or 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 ctypes | |
| import os | |
| import subprocess | |
| import sys | |
| import tempfile | |
| import traceback | |
| import pandas as pd | |
| MessageBoxW = ctypes.windll.User32.MessageBoxW |
This file contains hidden or 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
| from serial import Serial | |
| class ExpoVoltageController: | |
| vid: int = 0x2341 | |
| pid: int = 0x0058 | |
| sid: str = "8E4E27AB515146544E4B2020FF090D2F" | |
| def __init__(self, port: str, verbose: bool = False) -> None: | |
| self.serial = Serial(port, baudrate=115200, timeout=10) |
This file contains hidden or 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
| $VMName = 'MyVirtualMachine' | |
| $IPAddress = '172.16.0.0' | |
| Start-VM -Name $VMName | |
| If (-Not $?) { Pause ; Exit } | |
| Write-Host "Waiting for VM to reply to ping request. This window will close when VM is up." | |
| Do { $Ping = Test-Connection $IPAddress -Count 1 -Quiet } Until ( $Ping ) |
This file contains hidden or 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 shutil | |
| from pathlib import Path | |
| from conda.cli.python_api import Commands, run_command | |
| PACKAGE_NAME = 'poppler' | |
| PACKAGE_VERSION = '20.12.1' | |
| PACKAGE_ENV_DIR = './poppler-env/' |
This file contains hidden or 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
| @ECHO OFF | |
| start /B "Xming" "C:\Program Files (x86)\Xming\Xming.exe" :0 -multiwindow -clipboard -dpi 108 | |
| set DISPLAY=127.0.0.1:0 | |
| echo Started X server (Xming). | |
| ssh my-host | |
| if errorlevel 1 pause |
This file contains hidden or 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
| $repo = "ninja-build/ninja" | |
| $file = "ninja-win.zip" | |
| $dest = "C:\Program Files\Ninja" | |
| $releases = "https://api.github.com/repos/$repo/releases/latest" | |
| $asset = Invoke-RestMethod -Uri $releases | | |
| Select-Object -ExpandProperty assets | | |
| Where-Object {$_.name -eq $file} | |
| $tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } -PassThru |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Use Consolas font - cppreference.com | |
| // @match https://*.cppreference.com/* | |
| // @grant GM_addStyle | |
| // @run-at document-start | |
| // ==/UserScript== | |
| GM_addStyle ( ` | |
| body { | |
| zoom: 110%; |
NewerOlder