Skip to content

Instantly share code, notes, and snippets.

View kevinslin's full-sized avatar

Kevin Lin kevinslin

View GitHub Profile
@kevinslin
kevinslin / .vimrc.plugins
Created May 17, 2019 17:20
vim plugin and options
" --- Plugins {{{1
call plug#begin('~/.local/share/nvim/plugged')
" --- Essential {{{2
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'plasticboy/vim-markdown'
Plug 'SirVer/ultisnips'
Plug 'xolox/vim-session'
" --- UI {{{2
def lambda_handler(event, context):
"""
Main event handler, calls thumbor with received event.
"""
try:
start_time = timeit.default_timer()
global log_level
log_level = str(os.environ.get('LOG_LEVEL')).upper()
if log_level not in [
'DEBUG', 'INFO',
@kevinslin
kevinslin / shell.rc
Created June 24, 2019 16:51
history file
# log all history in bash with ctx
# format: {time} {cwd} {cmd}
# eg: 2018-02-03T23:12:22 /Users/kevinlin/Dropbox/code python
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi'
# log all history in zsh with ctx
# format: {time} {cwd} {cmd}
# eg: 2018-02-03T23:12:22 /Users/kevinlin/Dropbox/code python
precmd() {
if [ "$(id -u)" -ne 0 ]; then echo $(date "+%Y-%m-%dT%H:%M:%S") $(pwd) $(fc -l -1 | awk '{for(i=2;i<=NF;++i)printf("%s ", $i)}') >> ~/.logs/zsh-history-$(date "+%Y-%m-%d").log; fi
@kevinslin
kevinslin / tmobile support conversation
Last active July 23, 2019 23:20
tmobile metro support conversation
# Transcript of chat with tmobile metro support.
# Made some newline changes to group related threads and added `***` in places to preserve identities but otherwise unedited
Metro: Hi! How can we help you today?
Metro: Welcome to METRO by T-MOBILE, You are chatting with **** ID number ****. how can i help you?
You: i can't download pdf from the metro website
Metro: HI Kevin , oh my that is really kind of a hassle. Have you tried using a different browser to download it?
You: yes
You: chrome and firefox
@kevinslin
kevinslin / bucketNotification.ts
Last active August 5, 2019 18:51
Example of bucket notifications in CDK
const bucket = new Bucket(this, 'fooBucket');
const fn = new lambda.Function(this, 'fooFunc', {
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'lambda.handler',
code: lambda.Code.asset('functions/fooFunc'),
timeout: Duration.seconds(60)
});
bucket.addEventNotification(
@kevinslin
kevinslin / Bucket.ts
Created August 7, 2019 16:47
generated bucket definition file
export declare class CfnBucket extends cdk.CfnResource {
/**
* The CloudFormation resource type name for this resource class.
*/
static readonly CFN_RESOURCE_TYPE_NAME = "AWS::S3::Bucket";
/**
* @cloudformationAttribute Arn
*/
readonly attrArn: string;
@kevinslin
kevinslin / test
Created April 27, 2020 20:55
test
This is a test git
@kevinslin
kevinslin / CLA.md
Last active July 21, 2022 21:05
CLA for Dendron

Contribution License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”), and conveys certain intellectual property and license rights to Dendron Inc. and its affiliates (“Dendron”) for Your contributions to Dendron open source projects. This Agreement is effective as of the latest signature date below.

1. Definitions.

“Code” means the computer software code, whether in human-readable or machine-executable form, that is delivered by You to Dendron under this Agreement.

“Project” means any of the projects owned or managed by Dendron in which software is offered under a license approved by the Open Source Initiative (OSI) (www.opensource.org) and documentation offered under an OSI or a Creative Commons license (https://creativecommons.org/licenses).

@kevinslin
kevinslin / journal.schema.yml
Created August 23, 2020 03:59
Schema Examples
# schema for journals
# the following schema will match the follwoing
#
# journal
# journal.2020
# journal.2020.09
# journal.2020.09.12
# journal.2020.09.12.foo.md
version: 1

Synopsis

tar [bundle-flags <args] [<file> | <pattern> ...]

Options

  • -c: create new archive
  • -d: find difference bwt files in the archive
  • -v: verbose