Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Rainbow justinrainbow

  • Phoenix, AZ
View GitHub Profile
View PHP Capistrano Recipe.rb
# --------------------------------------------
# General
# --------------------------------------------
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments.
set :application, "domain.com" # Application name
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ...
# --------------------------------------------
# Server
# --------------------------------------------
View plugin_route.php
<?php
/**
* PluginRoute class.
*
* Route class for plugins that allows you to clean up urls for plugins
* without tons of calls to Router::connect() to shorten controller names in urls.
*/
class PluginRoute extends CakeRoute
{
@m3nt0r
m3nt0r / default.tpl
Created Sep 21, 2010
TwigView for CakePHP
View default.tpl
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
{{ html.charset() }}
<title>{{ 'CakePHP: the rapid development php framework'|trans }}: {{ title_for_layout }}</title>
{{ html.meta('icon') }}
{{ html.css('cake.generic') }}
{{ scripts_for_layout }}
</head>
<body>
@erikeldridge
erikeldridge / demo.html
Created Oct 11, 2010
A simple YUI 3 module for adding Yahoo! login to a page
View demo.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- Licensed under Yahoo! BSD license http://gist.github.com/375593 -->
</head>
<body>
<span id="login"></span>
@pminnieur
pminnieur / SecurityController.php
Created Oct 27, 2010
Symfony2 Security Form Login
View SecurityController.php
<?php // src/Application/UserBundle/Controller/SecurityController.php
namespace Application\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\Security\SecurityContext;
class SecurityController extends Controller
{
public function loginAction()
@ornicar
ornicar / config.yml
Created Oct 29, 2010
DoctrineUserBundle YAML config
View config.yml
doctrine_user.config:
db_driver: odm
class:
model:
user: Bundle\ExerciseUserBundle\Document\User
group: ~
permission: ~
form:
user: ~
group: ~
@lenary
lenary / gitconfig.ini
Created Feb 18, 2011
a special excerpt of my gitconfig
View gitconfig.ini
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v
View jquery.background-noise.js
jQuery.fn.noisy = function(opacity) {
if (typeof(opacity) === 'undefined') {
opacity = 0.1;
}
var wrapper = jQuery(this).wrapInner('<div />').children();
var canvas = document.createElement("canvas");
canvas.width = 100;
canvas.height = 100;
var ctx = canvas.getContext("2d");
@karmi
karmi / ElasticSearch.org.Website.Search.FieldNotes.markdown
Created Apr 8, 2011
Field notes gathered during installing and configuring ElasticSearch for http://elasticsearch.org
View ElasticSearch.org.Website.Search.FieldNotes.markdown

ElasticSearch.org Website Search: Field Notes

These are field notes gathered during installation of website search facility for the ElasticSearch website.

You may re-use it to put a similar system in place.

The following assumes:

@karmi
karmi / _readme.markdown
Created Apr 19, 2011
Simplistic Full-Text Search With Redis' Sorted Sets
View _readme.markdown

Simplistic Full-Text Search With Redis's Sorted Sets

Howto

git clone git://gist.github.com/923934.git redisearch

cd redisearch
You can’t perform that action at this time.