This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stepThrough() { | |
var instructions = document.getElementsByTagName('pre')[0].textContent; | |
var regexp = /[()]/g; | |
var split = instructions.match(regexp); | |
var floor = 1; | |
var i = 0; | |
do { | |
floor = split[i] === "(" ? floor + 1 : floor - 1; | |
i++; | |
} while (floor > 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://davidwalsh.name/vendor-prefix | |
var prefix = (function () { | |
var styles = window.getComputedStyle(document.documentElement, ''), | |
pre = (Array.prototype.slice | |
.call(styles) | |
.join('') | |
.match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']) | |
)[1], | |
dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1]; | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OLD | |
function canUseLocalStorage() { | |
return typeof localStorage === 'object' && localStorage.setItem; | |
}; | |
// NEW | |
function canUseLocalStorage() { | |
var ls = "vox"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" charset="utf-8"> | |
FC.checkout.config.customShipping = { | |
onLoad: true, // Set to false if you don't want shipping calculated when the checkout loads | |
onLocationChange: true // Set to true if your shipping logic relies on updating whenever the shipping location for the order changes | |
}; | |
function calculateShipping() { | |
var shippingCost = 0; | |
/* BEGIN CUSTOM SHIPPING LOGIC */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.feed-section-header { | |
margin: 0; | |
font-size: 1.1em; | |
$groups: community $community \70, teams $teams \72, college $college \71, for-you $gray \6b; | |
@each $group in $groups { | |
&.#{nth($group, 1)} { | |
color: #{nth($group, 2)}; | |
.feed-icon { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc /usr/local/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log [ruby-1.9.3-p125] | |
FATAL: could not create shared memory segment: Invalid argument | |
DETAIL: Failed system call was shmget(key=5432001, size=14442496, 03600). | |
HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 14442496 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections. | |
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for. | |
The PostgreSQL documentation contains more information about shared memory configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$root = $_SERVER['DOCUMENT_ROOT']; | |
chdir($root); | |
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); | |
if(file_exists($root.$path)) | |
{ | |
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') | |
{ | |
header('location: '.rtrim($path,'/').'/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class @Feed | |
constructor: (@func)-> | |
@callbacks = $.Callbacks() | |
init: -> | |
@subscribe( @func ) | |
subscribe: => | |
@callbacks.add( @func ) | |
publish: (args)=> | |
if args.length < 1 | |
@callbacks.fire @func |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function csextra_block($op = 'list', $delta = 0, $edit = array()) | |
{ | |
switch ($op) { | |
case 'list': | |
$blocks[0]['info'] = t('Send To a Friend Form'); | |
$blocks[1]['info'] = t('Sign Up for Our Newsletter'); | |
$blocks[2]['info'] = t('Event Ticket Button`'); | |
return $blocks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NoMethodError in Manage/progress_reports#index | |
Showing /Users/CS_Spare/.rvm/gems/ruby-1.9.3-p125@carecom/gems/datagrid-0.6.2/app/views/datagrid/_row.html.erb where line #3 raised: | |
undefined method `name' for #<Patient:0x007ffbadc912a0> | |
Extracted source (around line #3): | |
1: <tr class="<%= options[:cycle] && cycle(*options[:cycle]) %>"> | |
2: <% grid.columns.each do |column| %> | |
3: <td class="<%= datagrid_column_classes(grid, column) %>"><%= datagrid_format_value(grid, column, asset) %></td> |