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
| //! Usage: | |
| //! let peripherals = esp_hal::init(esp_hal::Config::default().with_cpu_clock(CpuClock::max())); | |
| //! let neopixels = ws2812_rmt::Ws2812::<'d>::new(peripherals.RMT, peripherals.GPIO3); | |
| use esp_hal::{ | |
| Blocking, gpio::{Level, OutputPin}, peripherals::RMT, rmt::{self, Channel, PulseCode, Tx, TxChannelConfig, TxChannelCreator}, time::Rate | |
| }; | |
| pub struct Ws2812<'d> { | |
| channel: Option<Channel<'d, Blocking, Tx>>, |
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
| -- AZURE doesn't support this extension yet | |
| -- ;CREATE EXTENSION IF NOT EXISTS permuteseq; | |
| CREATE OR REPLACE FUNCTION feistel_cipher_63( | |
| value bigint, | |
| crypt_key bigint, | |
| decrypt boolean DEFAULT false | |
| ) | |
| RETURNS bigint LANGUAGE plpgsql STRICT IMMUTABLE PARALLEL SAFE | |
| AS $$ |
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
| int4_bits_from_int8 := (WITH ValueAndShiftRight(int8_bits, shiftRight) AS ( | |
| SELECT -8187830383155378919::bigint, 32 | |
| ) | |
| SELECT | |
| (CASE (int8_bits::bit(64) >> shiftRight)::bigint & (1::bigint << 31) | |
| WHEN 0 THEN ((int8_bits::bit(64) >> shiftRight) & x'FFFFFFFF'::bigint::bit(64))::bigint | |
| ELSE ~((~((int8_bits::bit(64) >> shiftRight))::bigint & x'FFFFFFFF'::bigint)::int) END)::int | |
| FROM ValueAndShiftRight); | |
| int8_bits_from_int4 := (WITH ValueAndShiftLeft(int4_bits, shiftLeft) AS ( |
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
| $DeviceNamePattern = "Logi M650*"; ` | |
| $Outfile = "C:\bluetooth_device_keys.txt"; ` | |
| $Command = "powershell.exe"; ` | |
| $ScriptCommand = "" + ` | |
| "Get-PnpDevice -Class 'Bluetooth' | ? FriendlyName -like '$DeviceNamePattern' " + ` | |
| " | Select " + ` | |
| "FriendlyName, " + ` | |
| "@{N='MACAddress';E={Get-PnpDeviceProperty -InstanceId `$_.InstanceID | ? {`$_.KeyName -eq 'DEVPKEY_Bluetooth_DeviceAddress'} | Select -ExpandProperty Data }}" + ` | |
| "|% { `$device = `$_;" + ` | |
| "Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys -Recurse | ? {(Split-Path `$_.Name -Leaf) -eq `$device.MACAddress} " + ` |
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
| javascript:(function (el) { el.innerHTML = '#MailList .customScrollBar>div>div:first-child { opacity: 20%; } #MainModule:not([data-app-section])>div>div>:last-child { opacity: 20% }'; document.head.appendChild(el); })(document.createElement('style')); |
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
| FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F") | |
| FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F") |
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
| function* spiralWalk(dimensions: number): Generator<number[]> { | |
| function* spiralWalk_( | |
| dimensions: number, | |
| digits: number | |
| ): Generator<number[]> { | |
| if (dimensions === 0) { | |
| yield []; | |
| } else { | |
| for (let digit = 0; digit < digits; digit++) { | |
| for (let subwalk of spiralWalk_(dimensions - 1, digits)) { |
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
| # Might not work before Powershell 7 (`$PSVersionTable`) | |
| # Might not work before Posh-Git v1 (https://github.com/dahlbyk/posh-git#installing-posh-git-via-powershellget-on-linux-macos-and-windows) | |
| # | |
| # Find this file's path by running `$Profile` | |
| Import-Module posh-git | |
| $begin = (Get-Date) | |
| function Prefix { |
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
| /* adapted from recommended but unmaintained and archived | |
| smol/declaration-bundler-webpack-plugin. Rather than maintaining a fork, let's | |
| just see how far we can get by rolling it in */ | |
| module.exports = class DeclarationBundlerPlugin | |
| { | |
| out /* :string */; | |
| moduleName /* :string */; | |
| mode /* :string */; |
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
| #nowarn "40" | |
| open System | |
| // Complete Monadic Parsing "Library" | |
| type Parser<'r> = Parser of (char list -> ('r*char list) list) | |
| let parse (Parser p) = p | |
| let (>>=) p f = Parser(fun cs -> | |
| List.concat [for (r,cs') in parse p cs -> parse (f r) cs']) |
NewerOlder