Skip to content

Instantly share code, notes, and snippets.

@moshen
moshen / .slate
Created May 22, 2015 18:24
My Slate configuration
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
# Position aliases
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
@moshen
moshen / prompt.bash
Last active February 20, 2022 01:40
A Fancy Bash Prompt
#!/bin/bash
#
# Fancy prompt
#
# Source this file in your .bashrc
#
# Configuration options:
#
# Set _prompt_config to an array of strings. Each string is in the
@moshen
moshen / less-1.5.0.js
Last active December 26, 2015 04:19
Example of LESSCSS ticket #1599 https://github.com/less/less.js/issues/1599
/*!
* LESS - Leaner CSS v1.5.0
* http://lesscss.org
*
* Copyright (c) 2009-2013, Alexis Sellier <self@cloudhead.net>
* Licensed under the Apache v2 License.
*
* @licence
*/
diff --git a/lib/googlemaps.js b/lib/googlemaps.js
index cedb671..edb1189 100644
--- a/lib/googlemaps.js
+++ b/lib/googlemaps.js
@@ -354,10 +354,14 @@ exports.checkAndConvertPoint = function(input) {
var returnObjectFromJSON = function(callback) {
if (typeof callback === 'function') {
return function(err, jsonString) {
- try {
- callback(err, JSON.parse(jsonString));
@moshen
moshen / devonly_tag.rb
Created April 17, 2012 04:53
Jekyll Dev Only Tag
#
# Jekyll Dev Only Tag
#
# Author : Colin Kennedy
# Usage :
#
# The markup/script/css included within the `devonly` tags
# is included in the rendered page when either:
#
# * `server` mode is used
@moshen
moshen / asset_bundler.rb
Created March 23, 2012 05:40
Test asset_bundler with additional error message and no hard yui-compressor support
require 'yaml'
require 'digest/md5'
module Jekyll
class BundleTag < Liquid::Tag
@@supported_types = ['js', 'css']
def initialize(tag_name, text, tokens)
@moshen
moshen / gist_tag.rb
Created March 18, 2012 01:03 — forked from imathis/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
execve("/home/colin/perl5/perlbrew/perls/perl-5.14.1/bin/perl5.14.1", ["/home/colin/perl5/perlbrew/perls"..., "-t", "-Ilib", "t/handle-basic-tcp.t"], [/* 60 vars */]) = 0
brk(0) = 0x11f3000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5dc2ec6000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=36652, ...}) = 0
mmap(NULL, 36652, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5dc2ebd000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
execve("/home/colin/perl5/perlbrew/perls/perl-5.14.1/bin/perl5.14.1", ["/home/colin/perl5/perlbrew/perls"..., "-t", "-Ilib", "t/basic-tcp.t"], [/* 60 vars */]) = 0
brk(0) = 0xb13000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd06569b000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=36652, ...}) = 0
mmap(NULL, 36652, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fd065692000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
@moshen
moshen / nyan.pl
Created December 1, 2011 16:29
Terminal Nyancat 256 color
#!/usr/bin/env perl
use warnings;
use strict;
# Animation frames...
# Color ASCII escape sequences, gzipped and base64 encoded, because
# I thought 300 lines of animation frames was a little much.
my @frames = ( q(
H4sIAHywIU8AA+1d23XkOA797xT8oxBst+11z4QyMVQO+7ExbIAbydrdVXqCeJOEKNQZnzMURIq4
BEAU6jb19M/b59/vfz/fnv78z8uvj9u0+zz98yUFrrI6PG473nX8wA/68cSYI+fze/hlNkvz9fWV