Skip to content

Instantly share code, notes, and snippets.

View lxcodes's full-sized avatar

Alexander lxcodes

  • fh group
  • Erie, PA
View GitHub Profile
{
"name":"Calendar",
"unit_price":15.00,
"expense_account_id":"5072d350d57debd2b900001d",
"income_account_id":"5072d350d57debd2b900000a",
"description":"This is a test calendar item that will be sold on the online store"
}
@lxcodes
lxcodes / gist:3777560
Created September 24, 2012 18:44
MailChimp Mobile Trigger
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
/* Put your iPhone 4g styles in here */
}
/* Android targeting */
@media only screen and (-webkit-device-pixel-ratio:.75){
/* Put CSS for low density (ldpi) Android layouts in here */
}
@media only screen and (-webkit-device-pixel-ratio:1){
/* Put CSS for medium density (mdpi) Android layouts in here */
@lxcodes
lxcodes / configuration.coffee
Created July 19, 2012 13:26
Passport.js Trouble
app.configure(() ->
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/app/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.bodyParser());
app.use(express.session({
secret: 'xxx',
<cffunction name="sanitize" output="no" returntype="string" access="public">
<cfargument name="html" required="yes" type="string">
<cfset variables.reTags = '<[^>]*(>|$)'>
<cfset variables.reWhitelist = '(?x) ^</?(b(lockquote)?|code|d(d|t|l|el)|em|h(1|2|3)|i|kbd|li|ol|p(re)?|s(ub|up|trong|trike)?|ul)>$ | ^<(b|h)r\s?/?>$'>
<cfset variables.reWhitelistLinks = '(?x) ^<a\s href="(\##\d+|(https?|ftp)://[-a-z0-9+&@##/%?=~_|!:,.;\(\)]+)" (\stitle="[^"<>]+")?\s?>$ | ^</a>$'>
<cfset variables.reWhitelistImages = '(?x) ^<img\s src="https?://[-a-z0-9+&@##/%?=~_|!:,.;\(\)]+" (\swidth="\d{1,3}")? (\sheight="\d{1,3}")? (\salt="[^"<>]*")? (\stitle="[^"<>]*")? \s?/?>$'>
<cfset var L = structNew()>
<cfset L.result = arguments.html>
<cfif len(arguments.html) GT 0>
<cfset L.tags = $findAll(variables.reTags, arguments.html)>
@lxcodes
lxcodes / Slim HTML5 Boilerplate Conditional Comments
Created March 3, 2012 18:46 — forked from helloluis/Slim HTML5 Boilerplate Conditional Comments
How to get HTML5 Boilerplate-style Conditional Comments Working in Slim
doctype html
/[if lt IE 7]
| <html class="ie6">
/[if IE 7]
| <html class="ie7">
/[if IE 8]
| <html class="ie8">
/[if IE 9]
| <html class="ie9">
| <!--[if (gte IE 9)|!(IE)]<!--> <html> <!--<![endif]-->
~ ❯ brew install libvpx ⏎
==> Downloading http://webm.googlecode.com/files/libvpx-v1.0.0.tar.bz2
File already downloaded in /Network/Servers/macserver1.fh.private/Volumes/fh-clients/Users/alexa/Library/Caches/Homebrew
==> ../configure --prefix=/usr/local/Cellar/libvpx/1.0.0 --enable-pic --enable-vp8
Configuring selected codecs
enabling vp8_encoder
enabling vp8_decoder
Configuring for target 'x86_64-darwin11-gcc'
enabling x86_64
enabling runtime_cpu_detect
@lxcodes
lxcodes / bisect.rb
Created February 4, 2012 00:23
bisect_left
# Taken from Python bisect
def bisect_left(a, x, lo=0, hi=nil)
# Return the index where to insert item x in list a, assuming a is sorted.
# The return value i is such that all e in a[:i] have e < x, and all e in
# a[i:] have e >= x. So if x already appears in the list, a.insert(x) will
# insert just before the leftmost x already there.
# Optional args lo (default 0) and hi (default len(a)) bound the
# slice of a to be searched.
@lxcodes
lxcodes / app.js
Created January 2, 2012 21:11
Node.js Routing Issue
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, mongoose = require('mongoose');
var app = module.exports = express.createServer();
Exception: System.InvalidOperationException
Message: Field property is required. All field web controls require the field name to be set.
Source: Sitecore.Kernel
at Sitecore.Web.UI.WebControls.FieldControl.DoRender(HtmlTextWriter output)
at Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at Sitecore.Web.UI.WebControls.Sublayout.DoRender(HtmlTextWriter output)
@lxcodes
lxcodes / gist:1410794
Created November 30, 2011 20:59
Best Way to Add Popup Pane
settingsButton: SC.ImageButtonView.create({
layout: {top: 3, right: 10, width: 48, height: 48 },
action: function(){
SC.PanelPane.create({
layout: { width: 400, height: 200, centerX: 0, centerY: 0 },
contentView: SC.View.extend({
value:'rawr'
})
}).append()
},