Skip to content

Instantly share code, notes, and snippets.

View pnomolos's full-sized avatar

Phil Schalm pnomolos

  • Jane.app
  • British Columbia, BC
  • 13:18 (UTC -12:00)
  • X @pnomolos
View GitHub Profile
@pnomolos
pnomolos / Gemfile
Last active August 29, 2015 14:17 — forked from solnic/ar_create.rb
Call-tree example for ActiveRecord vs. rom-sql
# A sample Gemfile
source "https://rubygems.org"
gem 'activerecord'
gem 'hotch'
gem 'rom-sql'
gem 'sqlite3'
Attaching to the process with GDB
Populate your .gdbinit and .gdb directories
In ~/.gdbinit:
define session-ruby
source ~/.gdb/ruby
end
@pnomolos
pnomolos / Foundation_Walker_Nav_Menu.php
Last active December 18, 2015 21:19 — forked from awshout/foundation4-topbar-menu.php
Nav Walker for Wordpress + Foundation 4 for your top nav menu.
<?php
// You'll want to include this file from functions.php, and add both theme support and register_nav_menus calls there
//
// add_theme_support('menus');
// register_nav_menus(array(
// 'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
// 'top-bar-r' => 'Right Top Bar'
// ));
jQuery.fn.ratingSelector = function(){
return $(this).each(function(){
var stars_element = null,
rating_element = null;
stars_element = $(this).find('span.rating_stars');
rating_element = $(this).find('input');
if (stars_element.size() && rating_element.size())
stars_element.click(function(ev){
var stars_coords = stars_element.offset();
var offset = ev.pageX - stars_coords.left;
@pnomolos
pnomolos / deploy.rb
Created January 4, 2012 16:58 — forked from jwo/deploy.rb
Capistrano with Unicorn Reloading
set :application, "yyyyyyyyyyy"
set :repository, "here-be-your-githubs"
set :scm, :git
set :branch, "master"
set :user, "xxxxxxxx"
set :scm_verbose, true
default_run_options[:pty] = true
set :deploy_via, :remote_cache
ssh_options[:forward_agent] = true
@pnomolos
pnomolos / MasterWidget.php
Created November 9, 2011 07:58 — forked from jonathonbyrdziak/CustomWidgetFile.php
Plugin code to create a single widget in wordpress.
<?php
/**
* @Author Jonathon byrd
* @link http://www.jonathonbyrd.com
* @Package Wordpress
* @SubPackage Widgets
* @copyright Proprietary Software, Copyright Byrd Incorporated. All Rights Reserved
* @Since 1.0.0
*
* Plugin Name: Master Widget
<? $this->render_partial('shop:product_options'); ?>
<? if (PSInventory_Inventory::out_of_stock( $product, post('product_options') )): ?>
<p>
<strong>
<? $options_string = PSInventory_Data::create_option_string(post('product_options', array()), $product->id);
$data = PSInventory_Data::create()->where('product_id=? AND options_string=?', $product->id, $options_string)->find();
$extended_sku = $data->extended_sku;
?>
We're sorry, the item (size/color/style) you've selected is temporarily out-of-stock.
<a href="<?= site_url('out-of-stock-contact-form') ?>?item=<?= urlencode($extended_sku); ?>" rel="lightbox[external 900 300]" title="Out of Stock Contact Form" id="oosLink" class="button">Notify me</a> when this item becomes available.