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
$signature = @" | |
[DllImport("user32.dll")] | |
public static extern bool SystemParametersInfo(int uAction, int uParam, ref | |
int lpvParam, int flags ); | |
"@ | |
$systemParamInfo = Add-Type -memberDefinition $signature -Name SloppyFocusMouse -passThru | |
[Int32]$newVal = 1 | |
$systemParamInfo::SystemParametersInfo(0x1001, 0, [REF]$newVal, 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
import decimal | |
def binary_split(a, b): | |
if b == a + 1: | |
Pab = -(6*a - 5)*(2*a - 1)*(6*a - 1) | |
Qab = 10939058860032000 * a**3 | |
Rab = Pab * (545140134*a + 13591409) | |
else: | |
m = (a + b) // 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
package main | |
import ( | |
"fmt" | |
"unsafe" | |
) | |
// Copy of hchan struct with first necessary fields. | |
// See: "src/runtime/chan.go" | |
type hchan struct { |
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
const { log, assert } = console | |
const { abs, max, sqrt } = Math | |
const dbg = (v) => console.log(typeof v, v) | |
const pow2 = v => v * v | |
const sum = (a,b) => a + b | |
const sub = (a,b) => a - b | |
const mul = (a,b) => a * b | |
const range = (length, fn) => Array.from({length}, (_, i) => fn(i)) |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"testing" | |
) | |
func BenchmarkAppend(b *testing.B) { | |
for i := 0; i < b.N; i++ { |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
_ "unsafe" | |
) |
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
# Place in /etc/udev/rules.d | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", ATTRS{idProduct}=="7321", MODE:="0666", GROUP="plugdev" |
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
#@title Canvas drawing library | |
import json | |
from typing import List | |
from IPython.display import HTML, Image | |
from google.colab.output import eval_js | |
canvas_html = """ | |
<div style="font: 11pt monospace; color:red; white-space:pre" id="error"></div> | |
<canvas width="{0}" height="{1}" style="height:{0}px;width:{1}px" id="canvas"></canvas> |
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
version: "3" | |
services: | |
traefik: | |
image: traefik:v2.10 | |
container_name: 'traefik' | |
command: | |
- '--log.level=DEBUG' | |
- '--api.insecure=true' | |
- '--api.dashboard=true' |
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
./Google\ Chrome --headless --disable-gpu --disable-logging --dump-dom http://google.com |
NewerOlder