Skip to content

Instantly share code, notes, and snippets.

@cgbystrom
cgbystrom / node.js vs Python
Created December 1, 2010 20:56
node.js vs Python with Greenlets
/*
node.js vs Python with Greenlets (say gevent)
I don't get why node.js is being so hyped.
Sure, the idea of writing things in JavaScript both on the client and server-side is really nice.
And JavaScript really fit an event-driven environment with its browser heritage.
But why on earth is boomerang code so appealing to write? I don't get. Am I missing something obvious?
All examples of node.js I see are littered with callbacks yet Ryan Dahl thinks coroutines suck. It doesn't add up for me.
@allanmac
allanmac / tk1_gpu_max_clock.sh
Last active August 14, 2017 13:25
Some login tweaks for L4T 19.3 to disable USB autosuspend and lock the GPU to max MHz. I have lines 3-11 of tk1_tweaks.sh appended to my .profile.
#!/bin/bash
#
# Lock GPU and MEM clocks to max MHz
#
# - benchmarking shows there is no need to override the MEM clock
#
echo
echo Locking GPU clock to max MHz for debugging porpoises...
# set to max
@Nihisil
Nihisil / jail.local
Last active September 5, 2023 06:20
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
@hyfen
hyfen / .bashrc
Created June 12, 2017 01:08
Save unlimited bash history in OSX
# save history to ~/.bash_history as soon as command is run
export PROMPT_COMMAND='history -a'
# save unlimited history
# osx doesn't seem to respect =-1 or = options
export HISTSIZE=9999999999
export HISTFILESIZE=999999999
# osx doesn't actually respect this and it'll fall back to unix timestamp (which we want)
export HISTTIMEFORMAT="%d/%m/%y %T "
@mjhong0708
mjhong0708 / update_alternatives_clang.sh
Created February 3, 2022 14:40
Update alternatives for clang
update-alternatives --install \
/usr/bin/clang clang /usr/bin/clang-13 200 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-13 \
--slave /usr/bin/clang-apply-replacements clang-apply-replacements /usr/bin/clang-apply-replacements-13 \
--slave /usr/bin/clang-change-namespace clang-change-namespace /usr/bin/clang-change-namespace-13 \
--slave /usr/bin/clang-check clang-check /usr/bin/clang-check-13 \
--slave /usr/bin/clang-cl clang-cl /usr/bin/clang-cl-13 \
--slave /usr/bin/clang-cpp clang-cpp /usr/bin/clang-cpp-13 \
--slave /usr/bin/clang-doc clang-doc /usr/bin/clang-doc-13 \
--slave /usr/bin/clang-extdef-mapping clang-extdef-mapping /usr/bin/clang-extdef-mapping-13 \