Skip to content

Instantly share code, notes, and snippets.

View Cnly's full-sized avatar
🍩
Absorbing donuts...

Cnly

🍩
Absorbing donuts...
View GitHub Profile
@Cnly
Cnly / .gitignore
Created September 13, 2014 05:46
A .gitignore for Java
#Eclipse
/.classpath
/.project
/.settings/
#Maven
/target
# various other potential build files
/build
@Cnly
Cnly / ssl-redirect.html
Last active October 4, 2015 10:44 — forked from konklone/ssl-redirect.html
Force a quick redirect to HTTPS on Github Pages for your domain (and only your domain)
<script>
if (window.location.host.indexOf('github.io') > -1 && window.location.protocol != "https:"){
window.location.protocol = "https";
}
</script>
@Cnly
Cnly / jdfcr
Last active July 7, 2016 01:04
JD-decompiled File Cleaning Regex
Search and replace all occurrences with empty string to clean up file(s) decompiled with JD.
\/\* \d+ \*\/ |\/\*\s+?\*\/ |\/\* Location:.+\n.+\n.+\n \*\/
@Cnly
Cnly / ip138.py
Created September 14, 2017 12:56
#! /usr/bin/env python
# Partial original code came from https://www.oschina.net/code/snippet_20912_46623
import urllib2
import re
import sys
import traceback
if len(sys.argv) < 2:
@Cnly
Cnly / xkbwime.sh
Created December 20, 2017 09:56
Remap keys on Gnome (E.g. Swap Alt and Ctrl) without screwing up input methods
#! /usr/bin/env bash
ALL_SOURCES="`gsettings get org.gnome.desktop.input-sources sources`"
SOURCE_COUNT="`echo $ALL_SOURCES | tr -d -c ')' | awk '{ print length; }'`"
CURRENT_SOURCE_STR="`gsettings get org.gnome.desktop.input-sources current`"
CURRENT_SOURCE="${CURRENT_SOURCE_STR#uint32 }"
next_source() {
if [ "$CURRENT_SOURCE" -lt $((SOURCE_COUNT - 1)) ]; then
gsettings set org.gnome.desktop.input-sources current $((CURRENT_SOURCE + 1))
@Cnly
Cnly / makedeployzip.sh
Last active January 4, 2018 08:34
Make deploy.zip for AWS Lambda
#! /usr/bin/env bash
rm -f deploy.zip
zip -9 -r deploy.zip . --exclude 'venv/*' '.*/*' '.*' '__pycache__/*'
cd venv/lib/python*/site-packages || exit 1
zip -9 -r ../../../../deploy.zip * --exclude 'setuptools-*/*' 'setuptools/*' 'pip-*/*' 'pip/*' 'pkg_resources-*/*' 'pkg_resources/*' 'wheel-*/*' 'wheel/*' '__pycache__/*' '*-info/*' 'easy_install.py'
cd ../../../../
#! /bin/bash
INTERNAL_IP4_NETMASK=128.0.0.0
INTERNAL_IP4_NETMASKLEN=8
INTERNAL_IP4_NETADDR=10.0.0.0
shopt -s expand_aliases
alias set_default_route=disabled
alias reset_default_route=disabled
.doc-upload, .nav-wrap, .docBubble, .wk-other-new-cntent, .doc-tag-wrap, .reader-back2top-wrap, .reader-tools-bar-wrap, .ugctest, .fix-searchbar-wrap {
display: none !important;
}
.header-wrap {
background: #FCFCFC;
}
#lemmaWgt-secondsKnow,
#side-share,
.navbar-bg-top,
.navbar-bg,
.navbar-wrapper,
.topbar,
.help,
.wgt-footer-main > .content,
.arrow,
.toggle-button,
.open-task-list, .jump-top, .top-nav-bar, .divider, #userbar {
display: none !important;
}
.search-block {
position: absolute;
}