Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 13, 2024 09:00
set -e, -u, -o, -x pipefail explanation
@maokwen
maokwen / AutoHotKey-Switch-IME.ahk
Last active May 13, 2024 08:57
AutoHotKey-Switch-IME
#Include %A_ScriptDir%
timeInterval := 500
; +-------------------------+-------------------------+
; | SubLanguage ID | Primary Language ID |
; +-------------------------+-------------------------+
; 15 10 9 0 bit
InChs() {
@equivalent
equivalent / README.md
Last active May 13, 2024 08:57
Rails 7 importmaps dropzone.js direct upload ActiveStorage

This is simple implementation of technologies in hobby project of mine built in Rails7 where I need direct upload to S3.

A Deep Dive into 'Regular Expressions': A guide on Regex

Have you ever used Control + F to search for a specific word or phrase? You've already used something like regular expressions before! Regular expressions, or regex for short, is a series of special characters that are used to define a search pattern! In context of code or search algorithms, regex can be used to find patterns within strings, or to find and replace characters or series of characters within a string.

Though regex is used in JavaScript, it's actually a universally used component in all languages, such as Python, Java, and C++.

This guide takes a deep dive into what regular expressions are and what they are used for in programming! Let's get started :)

Summary

@alexweberk
alexweberk / mlx_finetuning_gemma.ipynb
Last active May 13, 2024 08:56
MLX Fine-tuning Google Gemma
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@greymd
greymd / sudo新一.md
Last active May 13, 2024 08:55
sudo新一

 オレは高校生シェル芸人 sudo 新一。幼馴染で同級生の more 利蘭と遊園地に遊びに行って、黒ずくめの男の怪しげな rm -rf / 現場を目撃した。端末をみるのに夢中になっていた俺は、背後から近づいてきたもう1人の --no-preserve-root オプションに気づかなかった。 俺はその男に毒薬を飲まされ、目が覚めたら・・・ OS のプリインストールから除かれてしまっていた!

sudo がまだ $PATH に残っていると奴らにバレたら、また命を狙われ、他のコマンドにも危害が及ぶ』

 上田博士の助言で正体を隠すことにした俺は、 which に名前を聞かれて、とっさに『gnuplot』と名乗り、奴らの情報をつかむために、父親がシェル芸人をやっている蘭の $HOME に転がり込んだ。ところが、このおっちゃん・・・とんだヘボシェル芸人で、見かねた俺はおっちゃんになりかわり、持ち前の権限昇格能力で、次々と難タスクを解決してきた。おかげで、おっちゃんは今や世間に名を知られた名エンジニア、俺はといえばシェル芸 bot のおもちゃに逆戻り。クラスメートの convertojichattextimg にお絵かきコマンドと誤解され少年ワンライナーお絵かき団を結成させられる始末。

 ではここで、博士が作ってくれたメカを紹介しよう。最初は時計型麻酔 kill 。ふたについた照準器にあわせてエンターを押せば、麻酔シグナルが飛び出し、プロセスを瞬時に sleep させることができる。 次に、蝶ネクタイ型 banner 。裏についているダイヤルを調整すれば、ありとあらゆる大きさのメッセージを標準出力できる。必殺のアイテムなら fork 力増強シューズ。電気と磁力で足を刺激し、 :(){ :|:& };: でプロセステーブ

@qzchenwl
qzchenwl / elasticsearch-docker-compose.yml
Created April 27, 2024 07:04
elasticsearch docker compose
services:
setup:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.0
user: "0"
command: >
bash -c '
if [ x${ELASTIC_PASSWORD} == x ]; then
echo "Set the ELASTIC_PASSWORD environment variable in the .env file";
exit 1;
elif [ x${KIBANA_PASSWORD} == x ]; then
@franciscocpg
franciscocpg / README.md
Last active May 13, 2024 08:48
Import mitm certificate to CA in arch linux
  1. After installing mitmproxy run it (just type mitmproxy) in a terminal session and quit. This will create the necessaries certificates files at ~/.mitmproxy.

  2. Extract the certificate to .crt format:
    openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt

  3. Trust the certificate into CA:
    sudo trust anchor ca.crt

  4. Run the mitmproxy again

@lalithabacies
lalithabacies / api-key.txt
Created September 7, 2017 07:17
Open weather API key
BIT.LY link zu dieser Seite:
https://bit.ly/weather-api
API Key:
bd5e378503939ddaee76f12ad7a97608
API Doku:
http://openweathermap.org/current
How to use an API key: