defaults write -g NSScrollViewRubberbanding -int 0
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
defaults write com.apple.Dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -int 0
defaults write com.apple.finder DisableAllAnimations -bool true
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
defaults write NSGlobalDomain NSWindowResizeTime .001
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" | |
"sync" | |
"time" | |
) | |
type Session struct { | |
Id string |
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
{ | |
"theme": "Atelier Sulphurpool Dark", | |
"buffer_font_size": 12, | |
"hard_tabs": false, | |
"tab_size": 2, | |
"auto_update": true, | |
"remove_trailing_whitespace_on_save": false, | |
"projects_online_by_default": false, | |
"blinking": "off", | |
"format_on_save": "off", |
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 math | |
import random | |
elt_offsets = [] | |
elts = ['a', 'b', 'c', 'd'] | |
m = 176 | |
mx = 0 | |
# pre-render, best height approximation |
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 React, { useState, useReducer, useEffect, useContext } from 'react'; | |
const Ctx = React.createContext(); | |
const Display = () => { | |
return ( | |
<Ctx.Consumer> | |
{ ctx => ( <span>value: {ctx.a}</span> ) } | |
</Ctx.Consumer> | |
); |
sudo apt-get -f install --yes
cd /tmp
chmod a+x dtc-compile.sh
./dtc-compile.sh
dtc -I dts -O dtb -o bananapi-m2-zero-eth0.dtbo bananapi-m2-zero-eth0.dts
sudo mkdir -p /boot/overlay-user
As the Keychron K3 keyboard with UK layout has the great L-shaped ENTER key but the uncomfortable placed "§±" and "`~" keys, here is a solution to swap both keys without any third party software on OSX.
hidutil property --set '{
"UserKeyMapping":[
{
"HIDKeyboardModifierMappingSrc":0x700000035,
"HIDKeyboardModifierMappingDst":0x700000064
},
{
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
#include <vector> | |
#include <cstdio> | |
int main(int argc, char *argv[]) { | |
std::vector<int> x(10); | |
std::fprintf(stdout, "x.0: %lu\n", x.size()); | |
x.push_back(1); | |
x.push_back(2); | |
x.push_back(3); | |
std::fprintf(stdout, "x.1: %lu\n", x.size()); |
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 random | |
def icantbelieveitcansort(a: list) -> tuple: | |
ops = 0 | |
for i in range(0, len(a)): | |
for j in range(0, len(a)): | |
if a[i] < a[j]: | |
a[i], a[j] = a[j], a[i] | |
ops += 1 | |
return (a, ops) |
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
poller := zmq.NewPoller() | |
poller.Add(frontend, zmq.POLLIN) | |
poller.Add(backend, zmq.POLLIN) | |
for { | |
var sockets []zmq.Polled | |
sockets, err := poller.Poll(-1) | |
if err != nil { | |
break |
NewerOlder