Skip to content

Instantly share code, notes, and snippets.

@illucent
illucent / XresourcesXFCE.md
Created May 18, 2016 12:21 — forked from atweiden/XresourcesXFCE.md
Convert URxvt Xresources to XFCE terminal color theme
@illucent
illucent / common.loading.css
Last active May 4, 2016 14:55 — forked from tracend/common.loading.css
CSS3 Loading Overlay
body.loading:after {
/* with no content, nothing is rendered */
content: "";
position: fixed;
/* element stretched to cover during rotation an aspect ratio up to 1/10 */
top: -500%;
left: -500%;
right: -500%;
bottom: -500%;
z-index: 9999;
/*
Cross-browser (including IE8-10)
Más info: http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/
*/
.absolute-center {
/* height: must be declared */
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
@illucent
illucent / vanilla-not-jquery.js
Created May 3, 2016 20:18 — forked from TexRx/vanilla-not-jquery.js
Pure JS alternatives to common CSS class jQuery functions
function hasClass(elem, className) {
return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');
}
function addClass(elem, className) {
if (!hasClass(elem, className)) {
elem.className += ' ' + className;
}
}
@illucent
illucent / ttf-vista-fonts-installer.sh
Created April 19, 2016 09:02 — forked from maxwelleite/ttf-vista-fonts-installer.sh
Script to install Microsoft Vista TrueType Fonts (TTF) on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.tumblr.com/
# Description: Script to install Microsoft Vista TrueType Fonts (TTF) on Ubuntu distros
# (Consolas, Candara, Corbel, Constantia, Cambria and Calibri)
# Dependencies: wget, fontforge and cabextract
# Tested: Ubuntu Saucy/Trusty
output_dir="/usr/share/fonts/truetype/vista"
tmp_dir="/tmp/fonts-vista"
@illucent
illucent / dj_prod_server.sh
Created April 6, 2016 19:05 — forked from hersonls/dj_prod_server.sh
How to install Django+Supervisor+Gunicorn+Nginx in a Ubuntu Server.Needed to adjust append settings, like append virtualenvwrapper settings in user .profile file.
#!/bin/env bash
# Update packages
apt-get update
# Installing services
echo "=============================="
echo "Install web services"
echo "=============================="
apt-get -y install nginx supervisor
@illucent
illucent / python_custom_openssl.diff
Created March 31, 2016 14:19 — forked from eddy-geek/ python_custom_openssl.diff
Compile python with statically linked openssl
--- a/setup.py 2014-03-17 03:31:31.000000000 +0100
+++ b/setup.py 2014-03-17 19:06:03.000000000 +0100
@@ -750,10 +750,8 @@
exts.append( Extension('_socket', ['socketmodule.c'],
depends = ['socketmodule.h']) )
# Detect SSL support for the socket module (via _ssl)
- search_for_ssl_incs_in = [
- '/usr/local/ssl/include',
- '/usr/contrib/ssl/include/'
- ]
@illucent
illucent / show-ip-before-login.sh
Created March 28, 2016 12:55 — forked from samrocketman/show-ip-before-login.sh
Show IP address on prelogin message
#!/bin/bash
# based on http://offbytwo.com/2008/05/09/show-ip-address-of-vm-as-console-pre-login-message.html
# based on https://gist.github.com/rm/3780228
# A better IP address method https://www.linuxquestions.org/questions/blog/sag47-492023/using-a-script-to-get-your-ip-address-35251/
# need to be root to write out these files
if [ "$(id -u)" != "0" ]; then
echo "Need to run as root. Maybe use sudo..."
exit
fi
@illucent
illucent / chrome-cahche-on-ramdisk.mkd
Created March 22, 2016 13:28 — forked from noromanba/chrome-cahche-on-ramdisk.mkd
Chrome(mium) cahche on ramdisk

Google Chrome cache to ramdisk optimization

performance improvements when running within slow I/O device

  • if install to flash-drive(aka pen-drive, flash-memory)
  • e.g. Linux working on flash-drive

command line option

add option to launching menu like this;

@illucent
illucent / get_name.py
Created March 22, 2016 11:11 — forked from pklaus/get_name.py
Extracting font names from TTF/OTF files using Python and fontTools
#!/usr/bin/env python
"""
From
https://github.com/gddc/ttfquery/blob/master/ttfquery/describe.py
and
http://www.starrhorne.com/2012/01/18/how-to-extract-font-names-from-ttf-files-using-python-and-our-old-friend-the-command-line.html
ported to Python 3
"""