Skip to content

Instantly share code, notes, and snippets.

View homerquan's full-sized avatar

Homer Quan homerquan

View GitHub Profile
// DO NOT MODIFY EXISITING DOM
var elem = document.createElement('link'); elem.rel = 'import';
elem.href = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'localhost:5000/elements/reflen-widget/reflen-widget.html';
elem.crossorigin = 'anonymous';
document.getElementsByTagName('head')[0].appendChild(elem);
cd /usr/local
sudo tar --strip-components 1 -xzf ~/Download/node-v4.2.2-linux-x64.tar.gz
sudo npm upgrade -g
cd /opt/VBoxGuestAdditions-*/init
sudo ./vboxadd setup
@homerquan
homerquan / sublime-text-2.sh
Created January 17, 2016 02:52
Install Sublime Text on Fedora.
#!/usr/bin/env bash
# Usage: {script} [ OPTIONS ] TARGET VERSION
#
# TARGET Default target is "/usr/local".
# VERSION If not defined tries to get the build into the Sublime Text 2 website.
#
# OPTIONS
#
# -h, --help Displays this help message.
#
#!/bin/sh
if [ $# -eq 0 ]; then
/opt/sublime_text_2/sublime_text . > /dev/null 2>&1 &
else
if [ ${1} == "--help" ]; then
/opt/sublime_text_2/sublime_text --help
else
/opt/sublime_text_2/sublime_text $@ > /dev/null 2>&1 &
fi
fi
@homerquan
homerquan / OpenWithSublimeText2.bat
Created February 2, 2016 15:50 — forked from mrchief/LICENSE.md
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
#!/bin/sh
MyGDomain=YOUR DOMAIN
Username=YOUR NAME
Password=YOUR PASS
CurrWANIP=$(wget http://ipinfo.io/ip -qO -)
echo "Google Domains DDNS: WAN IP Update into:$CurrWANIP"
curl -X POST -d [email protected] -H "User-Agent: curl" -s https://$Username:[email protected]/nic/update?hostname=$MyGDomain&myip=$CurrWANIP
echo "Google Domains DDNS: WAN IP update sent"
# Selinux fix for varnish
yum install policycoreutils-python
setsebool -P varnishd_connect_any 1
# AKKA Actor snippets
## [scala][akka] avoid sender mixing (using pattern match guard)
```
def receive = {
case x if sender == child1 => do sth
case x if sender == child2 => do sth else
case x => child forward x
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "puppetlabs/centos-7.0-64-puppet"
config.vm.host_name = "socket"
config.vm.network "forwarded_port", guest: 8004, host: 8004
config.ssh.forward_agent = true