Skip to content

Instantly share code, notes, and snippets.

View lzcabrera's full-sized avatar
:octocat:

Laura Cabrera lzcabrera

:octocat:
  • Victoria, BC
  • 02:12 (UTC -07:00)
View GitHub Profile
@lzcabrera
lzcabrera / browserdetect.js
Created March 27, 2012 04:17 — forked from grigs/browserdetect.js
Apple's Browser Detection Script - prettified from http://images.apple.com/global/scripts/browserdetect.js
if (typeof (AC) === "undefined") {
AC = {}
}
AC.Detector = {
getAgent: function () {
return navigator.userAgent.toLowerCase()
},
isMac: function (c) {
var d = c || this.getAgent();
return !!d.match(/mac/i)
@lzcabrera
lzcabrera / amplitude.js
Created March 4, 2012 01:09
Amplitude of An Array
var A = [-100, 2, 44, 0, 39, 5000010];
function amplitude(A){
var n = A.length;
var i;
var min_val;
var max_val;
var allowed_min = 0;
var allowed_max = 5000000;
var max_elements = 3;
@lzcabrera
lzcabrera / subcategories.xml
Created January 23, 2012 04:41
Extracting Unique Values with XSL By Dave Pawson as found on http://www.bernzilla.com/item.php?id=333 (Bernie Zimmermann's Blog)
<Main>
<Level>
<Category id="a">
<SubCategory>one</SubCategory>
<SubCategory>two</SubCategory>
<SubCategory>three</SubCategory>
</Category>
<Category id="b">
<SubCategory>one</SubCategory>
@lzcabrera
lzcabrera / httpd.conf
Created December 7, 2011 09:50
deploying 2 virtual hosts root using Apache
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /opt/railsapps/testone/public
ServerName domain1.com
ServerAlias domain1.com
ErrorLog logs/domain1-error_log
CustomLog logs/domain1-access_log common
<Directory /opt/railsapps/testone/public>
Allow from all
Options -MultiViews