My github language stats
This file contains hidden or 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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="$HOME/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
This file contains hidden or 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
# Add Docker's official GPG key: | |
sudo apt-get update | |
sudo apt-get install ca-certificates curl | |
sudo install -m 0755 -d /etc/apt/keyrings | |
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
sudo chmod a+r /etc/apt/keyrings/docker.asc | |
# Add the repository to Apt sources: | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
This file contains hidden or 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
fx_version 'cerulean' | |
games { 'gta5' } | |
client_script "script.lua" |
This file contains hidden or 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
/** | |
Modular exponentiation in AssemblyScript/TypeScript. Computes `a^b %n`. | |
Note that you'll likely need to change the int type. I'm using | |
the u128 (128-bit unsigned integer) from as-bignum. | |
@param a The base. | |
@param b The power. | |
@param n The modulus. | |
*/ | |
export function powMod(a: u128, b: u128, n: u128): u128 { |
I'm using this gist to collect a bunch of BNF grammars I've written, extracted, or found across the web. All of them are representations of existing languages. I found them useful, someone else might as well
C
c-grammar.bnf
- An incomplete representation of the C language in BNF (from 1988, all newer versions I could find were EBNF or PEG. Let me know if you have a better one.)
Adapted from The C Programming Language, 2nd edition, by Brian W. Kernighan and Dennis M. Ritchie,Prentice Hall, 1988.
This file contains hidden or 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 ev3dev2.sensor.lego import GyroSensor | |
gyro = GyroSensor() | |
gyro.mode = GYRO-ANG | |
def gyroPID(ki,kp,kd,target,wheel,speed,distance) | |
while True: | |
error = target - gyro.mode | |
integral = integral + error | |
error - last_error = derivative | |
integralResult = integral*ki |