Skip to content

Instantly share code, notes, and snippets.

View todesking's full-sized avatar
💀

todesking todesking

💀
View GitHub Profile
function jvm() {
local cmd="$1"
local java_root="/Library/Java/JavaVirtualMachines/"
case "$cmd" in
list )
find "$java_root" -maxdepth 1 | grep 'jdk.*\.jdk' | gsed 's/.*jdk\(.*\)\.jdk$/\1/' ;;
use )
local version="$2"
local home="$java_root/jdk${version}.jdk/Contents/Home/"
if [ -d "$home" ]; then
@todesking
todesking / bash.patch
Created September 25, 2014 15:03
This patch introduces very cool feature and no more vulnerability!!!
diff --git a/variables.c b/variables.c
index 92a5a10..b485dab 100644
--- a/variables.c
+++ b/variables.c
@@ -347,39 +347,6 @@ initialize_shell_variables (env, privmode)
temp_var = (SHELL_VAR *)NULL;
- /* If exported function, define it now. Don't import functions from
- the environment in privileged mode. */
@todesking
todesking / xor.cpp
Created August 31, 2019 09:08
given M and N, calc M xor M+1 xor ... xor N
// vim: shiftwidth=2 expandtab foldmethod=marker
// include {{{
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <map>
#include <queue>
@todesking
todesking / syn_region.vim
Last active September 27, 2020 09:22
syntax-region's odd behavior
syntax clear
syntax match expr_name /\K\k*/ nextgroup=B
syntax region outer
\ start=/(/ end=/)/
\ contains=inner
syntax region inner
\ start=/(/ end=/)/