Skip to content

Instantly share code, notes, and snippets.

View mariovisic's full-sized avatar

Mario Visic mariovisic

View GitHub Profile
From efc0891173d385bd4f62d7d531b3f9667a072c5e Mon Sep 17 00:00:00 2001
From: Mario Visic <mario@mariovisic.com>
Date: Wed, 24 Mar 2010 18:11:19 +0800
Subject: [PATCH] Alterd the styling of error messages displayed on admin forms
---
public/stylesheets/admin/main.css | 10 ++++++----
public/stylesheets/sass/admin/partials/_forms.sass | 15 ++++++++++-----
2 files changed, 16 insertions(+), 9 deletions(-)
From 150fa3eb223f39410b8c3a7d88b50fb164e1b1a7 Mon Sep 17 00:00:00 2001
From: Mario Visic <mario@mariovisic.com>
Date: Wed, 24 Mar 2010 22:20:20 +0800
Subject: [PATCH] Fixed a bug which could cause the preferences submenu to dissapear
---
lib/radiant/admin_ui.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/radiant/admin_ui.rb b/lib/radiant/admin_ui.rb
From 854c3f56eb23941bca3f56e6cab836709e5c4d0d Mon Sep 17 00:00:00 2001
From: Mario Visic <mario.visic@squaretalent.com>
Date: Wed, 30 Jun 2010 23:21:50 +0200
Subject: [PATCH] Removed a hard coded string and replaced with translation, fixes issue #103
---
app/views/admin/pages/edit.html.haml | 2 +-
config/locales/en.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@mariovisic
mariovisic / gist:660850
Created November 3, 2010 06:52
Basic Looping with 2+ incriment
<?php
# get the number of post elements
$count = count($_POST);
# get our array keys
$keys = array_keys($_POST);
# loop through them incrimenting by 2
# normally you would write $i++ at the end, this is shorthand for $i = $i + 1
@mariovisic
mariovisic / gist:709494
Created November 22, 2010 03:53
Mongoid find behaviour
form.id # => BSON::ObjectId('4ce9df0d4cfad1c62400001b')
form.messages.first.id # => BSON::ObjectId('4ce9e3d74cfad1cabd000006')
Form.find('4ce9df0d4cfad1c62400001b').to_s # => "#<Form:0x105673c60>"
Form.find('4ce9df0d4cfad1c624000010').to_s # Mongoid::Errors::DocumentNotFound: Document not found for class Form with id(s) 4ce9df0d4cfad1c624000010.
form.messages.find('4ce9e3d74cfad1cabd000006').to_s # => "#<Message:0x10527c170>"
form.messages.find('4ce9e3d74cfad1cabd000000').to_s # => ""
@mariovisic
mariovisic / _loan_product.html.haml
Created January 19, 2011 03:06
Rendering Partial collections in rails
# has access to loan_product instance variable.
let(:phone_number) { PhoneNumber.make(:number_type => 'emergency', :number => '0118 999 881 999 119 725 3') }
@mariovisic
mariovisic / blackboard.vim
Created March 10, 2011 03:37
Blackboard ViM theme (based off TextMate's blackboard theme)
" Vim color file
" This file was generated by Palette
" http://rubygems.org/gems/palette
"
" Author: Drew Neil
" Notes: Based on the 'Blackboard' theme from TextMate.
let colors_name="board"
hi clear
lol
this is a gist
@mariovisic
mariovisic / blackboard.vim
Created April 7, 2011 03:33
blackboard.vim
" Vim color file
" This file was generated by Palette
" http://rubygems.org/gems/palette
"
" Author: Drew Neil
" Notes: Based on the 'Blackboard' theme from TextMate.
let colors_name="board"
hi clear