Skip to content

Instantly share code, notes, and snippets.

View federivo's full-sized avatar

Federico Rivollier federivo

View GitHub Profile
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
class Mage_Paypal_Block_Standard_Redirect extends Mage_Core_Block_Abstract
{
protected function _toHtml()
{
$standard = Mage::getModel('paypal/standard');
$form = new Varien_Data_Form();
$form->setAction($standard->getConfig()->getPaypalUrl())
->setId('paypal_standard_checkout')
->setName('paypal_standard_checkout')
# Basic text search with relevancy for MongoDB.
# See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/
# Copythingie 2010 - Ward Bekker - ward@tty.nl
#create (or empty) a docs collection
doc_col = MongoMapper.connection.db('example_db').collection('docs')
doc_col.remove({})
#add some sample data
doc_col.insert({ "txt" => "it is what it is"})
@federivo
federivo / gist:4060609
Created November 12, 2012 17:18 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt