Skip to content

Instantly share code, notes, and snippets.

View HeySora's full-sized avatar

HeySora HeySora

View GitHub Profile
@derlin
derlin / PCSwissFrench.keylayout
Last active December 12, 2025 21:58
PC layout Swiss-French for MacOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!-- Key mapping for PC-style keys with Swiss French layout -->
<!--Last edited by Ukelele version 2.2.8 on 2015-06-02 at 17:10 (CEST)-->
<keyboard group="0" id="16101" name="PC Swiss French" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="commonModifiers" mapSet="ISO"/>
</layouts>
<modifierMap id="commonModifiers" defaultIndex="0">
<keyMapSelect mapIndex="0">
@Bradshaw
Bradshaw / better_sin.js
Created June 28, 2017 08:47
Better version of Math.sin for javascript
var old_sin = Math.sin;
Math.sin = function(x) {
if (typeof x == "number" && isFinite(x)){
return old_sin(x);
}
var str = "" + x;
if (str.length>0){
str = str.repeat(Math.ceil(Math.max(1,18/str.length)));
}
var sinstr = "|\n";
@raspi
raspi / enable-all-advanced-power-settings.ps1
Last active December 12, 2025 04:09
Enable all advanced power settings in Windows.
# List all possible power config GUIDs in Windows
# Run: this-script.ps1 | Out-File powercfg.ps1
# Then edit and run powercfg.ps1
# (c) Pekka "raspi" Järvinen 2017
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup
Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object {
$tmp = $_.ManagedElement