Skip to content

Instantly share code, notes, and snippets.

@Domiii
Domiii / TypingClubAutotyper.js
Last active July 9, 2025 22:48
This script types for you automatically on www.typingclub.com: 1. Open the website 2. Blaze past the tutorials 3. Go into a level 4. Open Console 5. Paste the script and press ENTER
/**
* This script types for you automatically on www.typingclub.com:
* 1. Open the website
* 2. Blaze past the tutorials
* 3. Go into a level
* 4. Open Console
* 5. Paste the script and press ENTER
*/
// NOTE: When delay (in ms between two strokes) is too low, the site might bug out and the result page will not be shown
@nyaapass
nyaapass / rm-rf-sougou-mac.sh
Last active January 1, 2021 02:45
rm -rf 搜狗 Mac 输入法
# 若安装包里自带卸载删不干净可以用以下命令
rm -rf /Library/Input\ Methods/SogouInput.app
rm -rf $HOME/Library/Caches/SogouServices
rm -rf $HOME/.sogouinput
@diegopacheco
diegopacheco / kaf-kafka-cli.md
Last active January 24, 2024 03:17
Kaf: Kafka CLI

Install Kaf

curl https://raw.githubusercontent.com/infinimesh/kaf/master/godownloader.sh | BINDIR=$HOME/bin bash
kaf config add-cluster local -b localhost:9092
kaf config select-cluster

Start Zookeper and Kafka

bin/zookeeper-server-start.sh config/zookeeper.properties
@mrts
mrts / markdown-to-slack.py
Last active March 28, 2025 21:48
Markdown to Slack
# Translates Markdown syntax to Slack, replaces:
#
# - hyphened lists with bullet symbols
# - double bold marker asterisks `**` with single asterisk `*`
# - headers `#` with bold marker asterisks `*`
#
# Run with
#
# python markdown-to-slack.py filename.md
#
@plbowers
plbowers / csvStringToArray.js
Last active September 9, 2022 07:55 — forked from Jezternz/csvStringToArray.js
forked and (1) added header capability and (2) added escaped characters more consistently for https://stackoverflow.com/questions/1293147/javascript-code-to-parse-csv-data
const csvStringToArray = (strData, header=true) =>
{
//const objPattern = new RegExp(("(\\,|\\r?\\n|\\r|^)(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|([^\\,\\r\\n]*))"),"gi");
const objPattern = new RegExp(("(\\,|\\r?\\n|\\r|^)(?:\"((?:\\\\.|\"\"|[^\\\\\"])*)\"|([^\\,\"\\r\\n]*))"),"gi");
let arrMatches = null, arrData = [[]];
while (arrMatches = objPattern.exec(strData)){
if (arrMatches[1].length && arrMatches[1] !== ",") arrData.push([]);
arrData[arrData.length - 1].push(arrMatches[2] ?
arrMatches[2].replace(new RegExp( "[\\\\\"](.)", "g" ), '$1') :
arrMatches[3]);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Ruby經典面試題目 Q1. 什麼是類別?What is a Class?
# 物件導向程式語言利用「可重複性」的概念,例如繼承(inheritance)來使軟體功能更易於維護。
class World
end
#Country繼承World
class Country < World
end
@gfredericks
gfredericks / all-these-class-files.org
Last active February 11, 2023 01:22
Some of the sources for my Clojure/conj 2018 slides

What Are All These Class Files Even About?, and Other Stories

Latex Prelude

@sbusso
sbusso / Embedding GoLang into a Ruby application.md
Created November 12, 2018 02:37 — forked from schweigert/Embedding GoLang into a Ruby application.md
Embedding GoLang into a Ruby application - Blogpost to Magrathealabs

Go Title

I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.

For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.

Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.

One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss

@bwenzel2
bwenzel2 / QuickSelect.txt
Created September 30, 2018 00:58
Pseudocode for the Quick Select algorithm
//This is an O(n) algorithm (linear)
Given an array A, of size n:
1. Pick a random index, p, as the pivot
2. Iterate through the array, comparing every element e to p, and counting the total number of elements before p
a. if e < p, move e to the left of p
b. if e > p, move e to the right of p
c. if e == p, leave e where it is
3. count the number of elements before p