Skip to content

Instantly share code, notes, and snippets.

@zamber
zamber / preview-shot.js
Last active August 29, 2015 13:58
DalekJS + Anvil -> screenshots for a dir full of .html files
/*
Iterate over the static frontend and make screenshots.
Point Anvil to the prod build dir where index.html is.
*/
// Get IP for ievms + anvil
// https://stackoverflow.com/questions/3653065/get-local-ip-address-in-node-js
var os = require('os');
var ip;
var ifaces = os.networkInterfaces();
/* jshint undef: true, unused: true */
/* global module */
module.exports = function(grunt) {
require('time-grunt')(grunt);
grunt.initConfig({ // task definitions below
// Compile LESS to css.
less: {
@zamber
zamber / analytics.js
Created April 9, 2014 15:28
Track downloads and external links with ga.js
/*
Track downloads and external links with ga.js
Append to your spagetti object container and then just run
self.Analytics.init() at the end of the global init() function.
*/
Analytics: {
init: function () {
var self = this;
#
# MTSH (MoreTerra Simple Helper) v0.1.0
# PowerShell 3.0
#
# Generate world images from Terraria world with MoreTerra
# Configure and fork it as you see fit.
#
# To schedule it as a task follow this http://j.mp/schedule-powershell
#
# To host it use http://cestana.com/mongoose.shtml
@zamber
zamber / .zshrc
Last active August 29, 2015 14:07
ZSH expanding aliases in emacs mode
################################################################################
# Change java version
################################################################################
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
@zamber
zamber / README.md
Last active August 29, 2015 14:11
Restore Chrome User Switching UI

Google Chrome just ruined the user switching UI. To restore it:

  1. Go to chrome://flags
  2. Disable #enable-new-profile-management
  3. Enable #enable-fast-user-switching
  4. Disable #enable-new-avatar-menu
@zamber
zamber / Limelight.css
Last active August 29, 2015 14:19
LimeChat - Limelight for ZNC
/*
LimeChat Limelight Theme
Modified for smaller server and status messages. Makes living with ZNC much easier.
*/
html {
font-family: "Dejavu Sans Mono", "Monaco", monospace;
font-size: 9pt;
background-color: #202020;
color: #FFFFFF;
@zamber
zamber / windowprops.sh
Created June 10, 2015 15:09
Key binding for getting window properties for writing i3-wm `for_window` rules
#!/bin/sh
# Get active window properties for writing `for_window` rules
# In ~/.i3/config:
# bindsym $mod+g ~/.i3/windowprops.sh
NAME=$(xprop -id `xdotool getactivewindow` | grep 'WM_NAME(STRING)')
CLASS=$(xprop -id `xdotool getactivewindow` | grep 'WM_CLASS(STRING)')
notify-send "$NAME
$CLASS"
@zamber
zamber / Preferences.sublime-settings
Created October 4, 2015 09:23
My Sublime Text 3 settings.
{
"binary_file_patterns":
[
".DS_Store",
"node_modules/",
"*.png",
"*.psd",
"*.jpg",
"*.gif",
"*.min.js",
@zamber
zamber / multipass-processing-example.xml
Last active December 17, 2015 03:59
An example of Xalan XSLT 1.0 multi-pass processing of nodes with some nice sorting options (show empty nodes last, case insensitive sort). Load it up in your favorite editor (Intellij IDEA in my case) and play with it :D.
<bookstore>
<book>
<title lang="en">everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price/>
</book>
<book>