Skip to content

Instantly share code, notes, and snippets.

@ringvold
ringvold / foxyshop-single-product
Created September 20, 2011 21:07
No product when updrading to foxyshop 3.3
<?php get_header(); ?>
<?php get_template_part( 'product', 'sidebar' ); ?>
<?php
//Hide page content if plugin is disabled
if (function_exists('foxyshop_insert_foxycart_files')) {
?>
<div id="foxyshop_container">
<div id="product">
<?php
foxyshop_include('header');
@ringvold
ringvold / foxyshop-single-product.php
Created September 20, 2011 21:11
No product output after upgrading to foxyshop 3.3
<?php get_header(); ?>
<?php get_template_part( 'product', 'sidebar' ); ?>
<?php
//Hide page content if plugin is disabled
if (function_exists('foxyshop_insert_foxycart_files')) {
?>
<div id="foxyshop_container">
<div id="product"> // Nothing after this point when upgrading to 3.3
<?php
foxyshop_include('header');
@ringvold
ringvold / rails_admin.nb.yml
Created May 31, 2012 17:37
Norwegian translation for RailsAdmin
# Norwegian, norsk bokmål (for Rails Admin)
# Contributors:
# - Theodor Tonum - www.yenka.no
# - Harald Ringvold - @harrir
nb:
admin:
home:
name: "Forside"
actions:
dashboard:
var globals = {
default_res: function() {
if (mobilNettleserTestFunksjon){
return "Mobile";
}
else {
return "Normal";
}
};, //(string) The default resolution
aspect_ratio: ( 16 / 9 ), // (float) The aspect ratio of our videos
@ringvold
ringvold / gist:3931408
Created October 22, 2012 13:02
kappAhlkampanje
<script type="text/javascript">
var _gaq_kap = _gaq || [];
_gaq_kap.push(['_setAccount', 'UA-33091826-4']);
_gaq_kap.push(['_setDomainName', 'blogg.no']);
_gaq_kap.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
@ringvold
ringvold / gist:4024221
Created November 6, 2012 11:48
Kappahl farsdag embedkode
<script type="text/javascript">
var _gaq_kap = _gaq || [];
_gaq_kap.push(['_setAccount', 'UA-33091826-4']);
_gaq_kap.push(['_setDomainName', 'blogg.no']);
_gaq_kap.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
@ringvold
ringvold / gist:4100837
Created November 17, 2012 22:34
activemodel
# fields_by_order.each do |field|
# new_field = "f.attribute :#{field.field_label}"
# eval(new_field)
# end
@ringvold
ringvold / gist:4100839
Created November 17, 2012 22:35
activemodel
# in Event.rb,
def inline_form
f = Class.new(Form)
yield f
f
end
def create_form()
form_maker = inline_form do |f|
fields_by_order.each do |field|
@ringvold
ringvold / gist:4227458
Created December 6, 2012 19:22
unicorn error
harald@web:/var/www$ unicorn_rails -c /var/www/unicorn/config/unicorn.rb -D
/var/www/unicorn/config/unicorn.rb:55:in `reload': undefined method `check_client_connection' for #<Unicorn::Configurator:0x915c6c0> (NoMethodError)
from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.4.0/lib/unicorn/configurator.rb:74:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.4.0/lib/unicorn/configurator.rb:74:in `reload'
from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.4.0/lib/unicorn/configurator.rb:67:in `initialize'
from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:107:in `new'
from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:107:in `initialize'
from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.4.0/bin/unicorn_rails:209:in `new'
from /usr/local/lib/ruby/gems/1.9.1/gems/unicorn-4.4.0/bin/unicorn_rails:209:in `<top (required)>'
from /usr/local/bin/unicorn_rails:19:in `load'
# encoding: utf-8
require 'rubygems'
require 'sinatra'
require 'data_mapper'
require 'json'
DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/grontlofte.db")
class Promise
include DataMapper::Resource