Skip to content

Instantly share code, notes, and snippets.

View yssource's full-sized avatar

龍共每文 yssource

View GitHub Profile
@yssource
yssource / utf7.py
Created May 1, 2017 08:34 — forked from gauteh/utf7.py
UTF8 to IMAP4-UTF-7 for OfflineIMAP
# -*- coding: utf-8- -*-
# from: http://piao-tech.blogspot.no/2010/03/get-offlineimap-working-with-non-ascii.html#resources
import binascii
import codecs
# encoding
def modified_base64 (s):
@yssource
yssource / .babelrc
Created February 20, 2018 17:33 — forked from Jman/.babelrc
Magento build system including sass, webpack and browser-sync
{
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
}
}],
"babili"
]
}

Template Org document for ODT export

Example

Using DataTable with Org tables

@yssource
yssource / gpg_test.py
Created May 18, 2018 04:21 — forked from ryantuck/gpg_test.py
working example of using gnupg in python
# install:
# pip3 install python-gnupg
# note - gpg needs to be installed first:
# brew install gpg
# apt install gpg
# you may need to also:
# export GPG_TTY=$(tty)
@yssource
yssource / myweechat.md
Created June 11, 2018 10:35 — forked from pascalpoitras/1.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

Enable mouse support

/mouse enable

Encrypted password in sec.conf

@yssource
yssource / subtrees.sh
Created June 14, 2018 00:44 — forked from nikita240/subtrees.sh
Convert git submodules to git subtrees
#!/bin/bash -x
# This script will convert all your git submodules into git subtrees.
# This script ensures that your new subtrees point to the same commits as the
# old submodules did, unlike most other scripts that do this.
# THIS SCRIPT MUST BE PLACED OUTSIDE OF YOUR REPOSITORY!!!!!!!!!!
# Otherwise, the script will interfere with the git commits (unless you add it to .gitignore).
# Save the script in your home directory as `~/subtrees.sh`
# `cd` into your repository
# Run `~/subtrees.sh`
# Enjoy!
@yssource
yssource / submodules_to_subtrees.sh
Created June 14, 2018 00:54 — forked from matthewberryman/submodules_to_subtrees.sh
Convert git repo from submodules to subtrees
cat .gitmodules |while read i
do
if [[ $i == \[submodule* ]]; then
mpath=$(echo $i | cut -d\" -f2)
read i; read i;
murl=$(echo $i|cut -d\ -f3)
mcommit=`eval "git submodule status ${mpath} |cut -d\ -f2"`
mname=$(basename $mpath)
echo -e "$name\t$mpath\t$murl\t$mcommit"
git submodule deinit $mpath
@yssource
yssource / split_into_2_files.py
Created January 15, 2019 11:09 — forked from lbillingham/split_into_2_files.py
python click + pytest example
# hello.py
import click
@click.command()
@click.option(
'--name', default='world',
prompt='greet whom?',
help='who should i greet?'
)
def main(name):
@yssource
yssource / Makefile
Created October 31, 2019 09:46 — forked from dtoma/Makefile
makefile rules to check style using clang-format
style:
@for src in $(SOURCES) ; do \
echo "Formatting $$src..." ; \
clang-format -i "$(SRC_DIR)/$$src" ; \
clang-tidy -checks='-*,readability-identifier-naming' \
-config="{CheckOptions: [ \
{ key: readability-identifier-naming.NamespaceCase, value: lower_case },\
{ key: readability-identifier-naming.ClassCase, value: CamelCase },\
{ key: readability-identifier-naming.StructCase, value: CamelCase },\
{ key: readability-identifier-naming.FunctionCase, value: camelBack },\