Skip to content

Instantly share code, notes, and snippets.

View pinguinson's full-sized avatar

Nikita Gusak pinguinson

  • Meta
  • London, UK
View GitHub Profile
@pinguinson
pinguinson / keybr-colemakdh-ortholinear-split.js
Created January 7, 2023 18:47 — forked from jonnyirwin/keybr-colemakdh-ortholinear-split
Inspired by https://gist.github.com/Zyst/3f58009943653e7873d30f1c748cf9ce, the following is used to help setup keybr.com to work for learning ColemakDH and specifically on an ortholinear split keyboard.
// ==UserScript==
// @name KeyBR Colemak-DH Ortholinear Split
// @namespace http://tampermonkey.net/
// @version v1.0
// @description Switch Colemak layout in keybr.com to Colemak DH Ortholinear Split
// @author https://github.com/jonnyirwin
// @match https://www.keybr.com/
// @icon https://www.google.com/s2/favicons?domain=keybr.com
// @grant none
// ==/UserScript==
@pinguinson
pinguinson / KeyBR Colemak-DH ANSI.js
Created December 13, 2022 00:22 — forked from Zyst/KeyBR Colemak-DH ANSI.js
Makes the KeyBR Colemak Layout be Colemak-DH on an ANSI Keyboard. Install with TamperMonkey
// ==UserScript==
// @name KeyBR Colemak-DH
// @namespace http://tampermonkey.net/
// @version v1.1
// @description Switch Colemak layout in keybr.com to Colemak DH
// @author https://github.com/Zyst
// @match https://www.keybr.com/
// @icon https://www.google.com/s2/favicons?domain=keybr.com
// @grant none
// @contributors https://github.com/hilarycheng
import java.math.MathContext
sealed trait Expression {
def compute: BigDecimal
def show: String
}
sealed trait Amount[T] extends Expression
sealed trait Constant extends Expression
class Example(serviceA: ServiceA, serviceB: ServiceB, serviceC: ServiceC) {
def sum(x: Int, y: Int): Int = {
serviceA.foo(x)
serviceB.bar(y)
// Doesn't call serviceC, so any test expecting it should fail
x + y
}
}
trait ServiceA {
when(mockSiebelIntegration.changeClientAddress(any())(any())).thenReturnAsync(xml)
when(mockSiebelIntegration.changeOfficeForAction(any(), any())(any())).thenReturnAsync(xml)
def ? = any()
when(mockSiebelIntegration.changeClientAddress(?)(?)).thenReturnAsync(xml)
when(mockSiebelIntegration.changeOfficeForAction(?, ?)(?)).thenReturnAsync(xml)
/***
Copyright (c) 2016, Alexander Choporov aka CoolCmd
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDE
#!/bin/python
import subprocess, time
target = 100
step = 5
cur_target = target
while True:
if "Discharging" in str(subprocess.check_output(["cat", "/sys/class/power_supply/BAT0/status"])):
aux = subprocess.check_output(["acpi"])
acpi_res = aux.split()
[gui]
absolute_position=
always_on_top=true
background_color=#000000
bounce=true
bounce_duration=500
font=Sans
font_size=13
font_variant=medium
foreground_color=#999999
@pinguinson
pinguinson / panel_bar
Created August 10, 2015 05:45
panel_bar
#! /bin/sh
. panel_colors
num_mon=$(bspc query -M | wc -l)
PADDING=" "
while read -r line ; do
case $line in
N*)
@pinguinson
pinguinson / panel
Last active August 29, 2015 14:27
panel
#! /bin/zsh
PANEL_FIFO=/tmp/panel-fifo
PANEL_HEIGHT=25
PANEL_FONT_FAMILY="Monaco:size=9"
ICON_FONT="FontAwesome:size=11"
if [ $(pgrep -cx panel) -gt 1 ]; then
printf "%s\n" "The panel is already running." >&2
exit 1