Skip to content

Instantly share code, notes, and snippets.

ijy /
Last active Jul 23, 2020
My Sublime Text 3 setup.

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following:
ijy / search-and-replace-2.xsl
Created Sep 15, 2013
Alternative search and replace template for XSLT 1.0.
View search-and-replace-2.xsl
string: The text to be evaluated
replace: The character or string to look for in the above string
with: What to replace it with
Slightly more long winded approach if that's how you prefer to roll.
<xsl:template name="string-replace">
ijy / check-null-empty.xsl
Created Sep 15, 2013
XSLT: Check if a string is null or empty.
View check-null-empty.xsl
<!-- Example XML -->
<id>item 1</id>
ijy / cartesian-product.js
Last active Mar 27, 2020
Underscore.js implementation of Cartesian Product (without any mutable variable). @see:
View cartesian-product.js
function cartesianProductOf() {
return _.reduce(arguments, function(a, b) {
return _.flatten(, function(x) {
return, function(y) {
return x.concat([y]);
}), true);
}, [ [] ]);
ijy / xhtml-to-markdown.xsl
Created Jul 21, 2013
XHTML to Markdown converter.
View xhtml-to-markdown.xsl
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- XHTML-to-Markdown converter by Andrew Green, Article Seven, -->
<!-- This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. -->
<xsl:stylesheet version='1.0' xmlns:h="" xmlns:xsl=''>
<xsl:output method='text' encoding='utf-8'/>
ijy / Laravel: Blade: Limit foreach loop.php
Created Jun 22, 2013
A quick and easy way to limit a foreach loop in Laravel Blade.
View Laravel: Blade: Limit foreach loop.php
@foreach (array_slice($posts->toArray(), 0, 5) as $post)
<h1>{{ $post['title'] }}</h1>
ijy /
Created May 7, 2018 — forked from bjmiller121/
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

ijy /
Created May 7, 2018 — forked from jedmao/
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Initialize a repo

Create an empty git repo or reinitialize an existing one

$ git init
ijy /
Created Jul 11, 2012 — forked from jpantuso/
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
ijy / banner.css
Created Mar 20, 2018
Tailwind, postcss-import, & cssnext media queries
View banner.css
.c-banner {
height: 400px;
outline: 5px solid red;
/* Breakpoints ========================================================= */
@media (--tablet) {
height: 500px;
You can’t perform that action at this time.