Skip to content

Instantly share code, notes, and snippets.

@davars
davars / NatualScrollingInWindows.ps1
Last active September 23, 2021 01:54 — forked from 101v/NatualScrollingInWindows.ps1
Powershell script to enable natural scrolling in Windows
# View registry settings
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
# Change registry settings
# Reverse mouse wheel scroll FlipFlopWheel = 1
# Normal mouse wheel scroll FlipFlopWheel = 0
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
# Restore default scroll direction
# Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 }
@davars
davars / remap-capslock-to-control-win10.md
Created December 15, 2020 15:53 — forked from joshschmelzle/remap-capslock-to-control-win10.md
Remap Caps Lock to Control on Windows 10

Create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00

or use PowerShell (run as Admin)

import(
"github.com/mitchellh/mapstructure"
)
type A struct {
One string
internalA string
}
### Keybase proof
I hereby claim:
* I am davars on github.
* I am davars (https://keybase.io/davars) on keybase.
* I have a public key whose fingerprint is B21D 53CD 9F67 406D B29D 10BD 7DF5 7B3D 8333 D8AE
To claim this, I am signing this object:
@davars
davars / gist:a9e40c8e19311e37f771
Created February 5, 2015 18:01
ModPagespeedPubliclyCacheMismatchedHashesExperimental
Index: src/net/instaweb/rewriter/rewrite_context.cc
===================================================================
--- src/net/instaweb/rewriter/rewrite_context.cc (revision 4522)
+++ src/net/instaweb/rewriter/rewrite_context.cc (working copy)
@@ -1020,8 +1020,9 @@
GoogleString output;
bool ok = false;
ResponseHeaders* response_headers = async_fetch_->response_headers();
- if (success_) {
- if (output_resource_->hash() == requested_hash_) {
@davars
davars / results.txt
Last active December 13, 2015 22:49 — forked from drasch/results.txt
$ time ruby test.rb #1.8.7
Timing ruby_no_func - 14.397207
Timing ruby_func - 30.25229
real 0m44.720s
$ time ruby test.rb #1.9.3
Timing ruby_no_func - 6.197986
Timing ruby_func - 9.45756
real 0m15.769s
(ns clj-misc.parse)
(defn result [v]
(fn [inp] [[v, inp]]))
(defn zero [inp] [])
(defn item [[x & xs]]
(if x
[[x, xs]]