Skip to content

Instantly share code, notes, and snippets.

Alex Chiang achiang

Block or report user

Report or block achiang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
set secure
set autoindent
set smarttab
set expandtab
set tabstop=8
@achiang
achiang / xps13_9360_ubuntu16.04.md
Last active Nov 11, 2019
Dell XPS 13 9360 + Ubuntu 16.04: fixing papercuts
View xps13_9360_ubuntu16.04.md

Upfront

View vyos config
firewall {
all-ping enable
broadcast-ping disable
config-trap disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name eth0in {
default-action reject
View gist:8d4a6e3f495084d6761c
$ python decl_enum.py
/home/vagrant/venv/lib/python3.4/site-packages/sqlalchemy/sql/default_comparator.py:153: SAWarning: The IN-predicate on "employee.type" was invoked with an empty sequence. This results in a contradiction, which nonetheless can be expensive to evaluate. Consider alternative strategies for improved performance.
'strategies for improved performance.' % expr)
2015-12-14 04:09:53,442 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1
2015-12-14 04:09:53,442 INFO sqlalchemy.engine.base.Engine ()
2015-12-14 04:09:53,443 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1
2015-12-14 04:09:53,444 INFO sqlalchemy.engine.base.Engine ()
2015-12-14 04:09:53,445 INFO sqlalchemy.engine.base.Engine PRAGMA table_info("employee")
2015-12-14 04:09:53,446 INFO sqlalchemy.engine.base.Engine ()
2015-12-14 04:09:53,447 INFO sqlalchemy.engine.base.Engine
View gist:b9914519119538b74bc8
The default wrapping in most tools disrupts the visual structure of the code, making it more difficult to
understand. The limits are chosen to avoid wrapping in editors with the window width set to 80, even if the tool
places a marker glyph in the final column when wrapping lines. Some web based tools may not offer dynamic line
wrapping at all.
Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that
can reach agreement on this issue, it is okay to increase the nominal line length from 80 to 100 characters
(effectively increasing the maximum length to 99 characters), provided that comments and docstrings are still
wrapped at 72 characters.
View lowDPI_external.sh
#!/bin/sh
xrandr --output eDP1 --auto --output DP1 --auto --panning 3840x2400+3200+0 --scale 2x2 --right-of eDP1
View gist:1b16a49f432375c68941
2015/05/01 Opening Balance
Assets:Cash 100 TZS
Equity:Initial Capital
2015/05/07 Prepay for EUR
Assets:Cash -50 TZS
Currency:TZS 50 TZS
Assets:EUR 55.556 EUR
Currency:EUR -55.556 EUR
View ubuntu-sdk-lxc-create
#!/bin/bash
# This script should be run with sudo
set -e
# Replace with Depends after conversion to package
apt-get install lxc systemd-services uidmap -y
########################################################################
## Setup for unprivileged container
@achiang
achiang / private.xml
Created Dec 18, 2013
Proper capslock behavior for Ubuntu / MacVim users
View private.xml
<?xml version="1.0"?>
<root>
<appdef>
<appname>MACVIM</appname>
<equal>org.vim.MacVim</equal>
</appdef>
<item>
<name>Caps to Control for MacVim only</name>
<identifier>private.macvimdef</identifier>
You can’t perform that action at this time.