Genereate alias for each of the git folder in ~/Documents
.
- Run the script
python3 alia_gen.py
- Add the following to
.bash_profile
# Added by Yuchen: using alias!
if [ -f ~/.alias_gen ]; then
#!/usr/bin/env bash | |
replace_or_fail() { | |
FROM_VALUE=$1 | |
TO_VALUE=$2 | |
FILENAME=$3 | |
echo "Replace from '$FROM_VALUE' to '$TO_VALUE' in '$FILENAME'... " | |
grep -q ${FROM_VALUE} ${FILENAME} && sed -i.old 's/'${FROM_VALUE}'/'${TO_VALUE}'/' ${FILENAME} || ( (>&2 echo "\033[0;31mError: '$FROM_VALUE' not found") && exit 1 ) | |
echo "Done. " | |
} |
Preferences > Key Bindings:
[
{ "keys": ["alt+command+l"], "command": "reindent" , "args": {"single_line": false}}
]
Preferences > Settings:
CC := g++ | |
CFLAGS := -Wall -g | |
TARGET := example | |
# $(wildcard *.cpp /xxx/xxx/*.cpp): get all .cpp files from the current directory and dir "/xxx/xxx/" | |
SRCS := $(wildcard *.cpp) | |
# $(patsubst %.cpp,%.o,$(SRCS)): substitute all ".cpp" file name strings to ".o" file name strings | |
OBJS := $(patsubst %.cpp,%.o,$(SRCS)) | |
all: $(TARGET) |
// Spark 2.1 | |
val spark = SparkSession.builder().master("local").getOrCreate() | |
// Given a list of mixture of strings in integers | |
val values = List("20030100013280", 1.0) | |
// Create `Row` from `Seq` | |
val row = Row.fromSeq(values) | |
// Create `RDD` from `Row` |
Dropbox Style Filename |
# smtplib module send mail | |
import smtplib | |
TO = 'recipient@mailservice.com' | |
SUBJECT = 'TEST MAIL' | |
TEXT = 'Here is a message from python.' | |
# Gmail Sign In | |
gmail_sender = 'sender@gmail.com' |
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |
<CodeBlocksConfig version="1"> | |
<editor> | |
<colour_sets> | |
<ACTIVE_COLOUR_SET> | |
<str> | |
<![CDATA[modnokai night shift v2]]> | |
</str> | |
</ACTIVE_COLOUR_SET> | |
<ACTIVE_LANG> |