Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
Discover gists
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
extension UIHostingController { | |
convenience public init(rootView: Content, ignoreSafeArea: Bool) { | |
self.init(rootView: rootView) | |
if ignoreSafeArea { | |
disableSafeArea() | |
} | |
} | |
func disableSafeArea() { |
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
#!/bin/bash | |
# Script to set the monitor brightness | |
# Creates a notification icon UI | |
ERR(){ echo "ERROR: $1" 1>&2; } | |
declare -i DEPCOUNT=0 | |
for DEP in /usr/bin/{xdotool,yad,xrandr};do | |
[ -x "$DEP" ] || { | |
ERR "$LINENO Dependency '$DEP' not met." |
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
# From https://github.com/tiangolo/fastapi/issues/258 | |
from typing import List | |
from fastapi import FastAPI | |
from starlette.responses import HTMLResponse | |
from starlette.websockets import WebSocket, WebSocketDisconnect | |
app = FastAPI() |
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
# 如果可以接受capslock作为输入法切换按键,强烈建议使用评论区脚本 | |
# 如果可以接受capslock作为输入法切换按键,强烈建议使用评论区脚本 | |
# 如果可以接受capslock作为输入法切换按键,强烈建议使用评论区脚本 | |
#Include %A_ScriptDir% | |
timeInterval := 500 | |
; +-------------------------+-------------------------+ |
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
[ | |
"😁", | |
"😂", | |
"😃", | |
"😄", | |
"😅", | |
"😆", | |
"😉", | |
"😊", | |
"😋", |
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
# Bash best practices and style-guide | |
Just simple methods to keep the code clean. | |
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/). | |
## Quick big rules | |
* All code goes in a function | |
* Always double quote variables |
A list of links containing cool references, resources and things related to books about Computer Science and related.
- Haskell Programming for First Principles
- Types and Programming Languages #math/type-theory
- Essentials of Compilation #computer-science/compilers
- How to design computer programs
- Structure and Interpretation of Computer Programs
- Introduction to Theory of Computation, Michael Sipser #computer-science/theory-of-computation
NewerOlder