Skip to content

Instantly share code, notes, and snippets.

View lululau's full-sized avatar
🎯
Focusing

FCP lululau

🎯
Focusing
  • Sunshine, Mountain East
View GitHub Profile
diff -Nur mituharu-emacs-mac-3ff676c2f98c/src/macappkit.m mituharu-emacs-mac-3ff676c2f98c-patched/src/macappkit.m
--- mituharu-emacs-mac-3ff676c2f98c/src/macappkit.m 2022-04-06 11:51:42.000000000 +0800
+++ mituharu-emacs-mac-3ff676c2f98c-patched/src/macappkit.m 2022-04-06 23:21:32.000000000 +0800
@@ -1935,6 +1935,17 @@
@implementation EmacsWindow
++ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSWindowStyleMask)styleMask
+{
+ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
diff --git a/src/macappkit.m b/src/macappkit.m
index fb7bf2a..732fbed 100644
--- a/src/macappkit.m
+++ b/src/macappkit.m
@@ -2262,6 +2262,18 @@ - (void)showMenuBar
@implementation EmacsWindow
++ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSWindowStyleMask)styleMask
+{
# $HOME/.k9s/plugin.yml
plugin:
# run-stk:
# # Define a mnemonic to invoke the plugin
# shortCut: r
# # What will be shown on the K9s menu
# description: kubectl run lululau/stk
# # Collections of views that support this shortcut. (You can use `all`)
# scopes:
@lululau
lululau / ruby-vs-java-python-rust.org
Created April 1, 2021 14:49
ruby-vs-java-python-rust

Range and Number

Collections

Enumerable

all?

Java

Stream.of(1, 2, 3, 4, 5).allMatch(x -> x < 10);

Python

ruby -i.bak -F, -ane '
p=$F[2].gsub(/省|市|自治区/, "");
c=$F[3].gsub(/市|自治./, "");
co=$F[4].gsub(/市|区|县|自治./, "");
$F[1]=$F[2]+$F[3]+$F[4]+$F[1].gsub(Regexp.new("^.*(%s|%s|%s)"%[$F[2],$F[3],$F[4]]), "").gsub(Regexp.new("^.*(%s|%s|%s)"%[p,c,co]), "");
$F[-1].chomp!
p1=$F[-3].gsub(/省|市|自治区/, "");
c1=$F[-2].gsub(/市|自治./, "");
#!/usr/bin/env zsh
for i in *.txt; do
echo '------------------------------------------------------'
base_name=${i%.txt}
contract_no=$(cat $i | iconv -c -f UTF-16LE | grep -o '合同 [0-9]*')
contract_no=${contract_no#* }
customer_name=$(cat $i | iconv -c -f UTF-16LE | grep -o '尊敬的 [^ ]*' )
customer_name=${customer_name#* }
customer_name=$(echo -n "$customer_name" | ruby -pe 'gsub(/[^\u4E00-\u9FA5]/, "?")')
# derived from josh.zsh-theme
ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}*%{$fg[blue]%})%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
function josh_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "
module Concerns
module Institution
module IOProcessorAble
extend ActiveSupport::Concern
def dq_io_processor(params={})
io_processor_of('dq', params)
end
def hq_io_processor(params={})
io_processor_of('hq', params)
@lululau
lululau / doc.sh
Created December 12, 2019 03:36
Safari Assistant Alfred Workflow Components
ALSF_UID=$(cat ~/Library/Safari/Bookmarks.plist | plutil -convert xml1 -o - -- - | grep -A4 '<string>Docs</string>' | tail -1 | sed 's/<\/.*//;s/.*>//')
# Which folder to browse is passed via workflow/environment variables
ALSF_UID=$ALSF_UID ./alsf browse -q "$1"