Skip to content

Instantly share code, notes, and snippets.

View ltcdnunez's full-sized avatar

Dave Nunez ltcdnunez

  • LinenTablecloth
  • Portland, OR
View GitHub Profile
@ltcdnunez
ltcdnunez / cheatsheet.md
Last active August 29, 2015 14:05
Markdown Cheatsheet

Markdown Cheatsheet

Headings

Create headings like so:

# Heading 1
## Heading 2
### Heading 3
@ltcdnunez
ltcdnunez / original_page_layout_update.xml
Last active August 29, 2015 14:03
Magento Google Content Experiments
<reference name="head">
<block type="cms/block" name="gce" before="-" >
<action method="setBlockId"><block_id>GOOGLE_CONTENT_EXPERIMENT_JS_CMS_BLOCK_ID_GOES_HERE</block_id></action>
</block>
</reference>
@ltcdnunez
ltcdnunez / quantile-count.R
Created February 10, 2013 02:18
R: Quantile Count
qcount = function(x, g, p, labels) {
d = lapply(split(x, g), function(n) {
q = quantile(unique(n), probs=p, names=F)
as.vector(cut(n, breaks=q, right=T, include.lowest=T, labels=labels), mode="character")
})
d = stack(d)
names(d) = NULL
table(d)
}
@ltcdnunez
ltcdnunez / Abstract.php
Created November 22, 2012 05:42 — forked from mclevenger/Abstract.php
Magento Overrride with patch for fixing the db deadlock error issue
Magento Overrride with patch for fixing the db deadlock error issue
FILE PATH:
/var/www/dev.linentablecloth.com/app/code/local/Mage/Sales/Model/Abstract.php
SOURCE CODE:
<?php
/**
@ltcdnunez
ltcdnunez / config
Created October 23, 2012 23:26
Git config for p4merge
[merge]
tool = p4merge
[diff]
tool = p4diff
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = false
keepBackup = false
@ltcdnunez
ltcdnunez / Configure-VirtualMachine.ps1
Created September 26, 2012 18:03
Configure Windows Virtual Machine
#requires -version 2
<#
.Synopsis
Prepares a virtual machine for use with Remote Desktop Virtualization.
.Description
This script configures the operating system on the virtual machine to work with Remote Desktop Virtualization. It performs following activities:
1. It enables Remote Desktop.
2. It enables Remote Procedure Call (RPC).
@ltcdnunez
ltcdnunez / hash_default_proc.rb
Created August 19, 2012 01:55
Default Hash Argument As Proc
example = Hash.new(Proc.new { raise Exception.new "Named action doesn't exist" }
example[:do_something_cool] = Proc.new { puts "I just did something cool!" }
example[:do_something_else_cool] = Proc.new { puts "I did another cool thing!" }
example[:do_something_cool].call
# => "I just did something cool!"
example[:do_something_else_cool].call
# => "I did another cool thing!"