Skip to content

Instantly share code, notes, and snippets.

View michaelminter's full-sized avatar

Michael Minter michaelminter

View GitHub Profile
<?php
public function executeQrcode(sfWebRequest $request)
{
require_once sfConfig::get('sf_lib_dir').
'/vendor/phpqrcode/qrlib.php';
$this->getResponse()->setContentType('image/png');
QRcode::png($request->getParameter('text'));
return sfView::NONE;
}
@yujiberra
yujiberra / gist:1144329
Created August 13, 2011 22:44
Bash profile with color current git branch color coded by status
# Git status bash prompt
#
# In addition to printing the current working directory, this prompt will
# show a number of things if you are in a git repository:
# - The current branch you are in
# - Whether there are untracked files in the repository (there will be an
# asterisk after the branch nome if there are)
# - Whether there are any unmerged/unstaged/staged changes or if the directory
# is clean. See below for the colors that will be used, and change them if
# you'd like.
@mattsears
mattsears / README.md
Created October 3, 2011 13:16
Todo.rb: A simple command-line TODO manager written in Ruby

Todo.rb

Todo.rb is a simple command-line tool for managing todos. It's minimal, straightforward, and you can use it with your favorite text editor.

Getting Started

Todo.rb doesn't require any third-party gems so you can copy the file anywhere and use it as long as it's executable:

@chetan
chetan / yardoc_cheatsheet.md
Last active May 4, 2024 11:12
YARD cheatsheet
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@taktran
taktran / shipit.rake
Created September 11, 2012 11:09
Ship it! rake task. Some details about the rationale here: http://blog.pebblecode.com/post/32263926012/ship-it
# Ship it! rake task
#
# Merge branch (master by default) to deployment branch, and deploy to server.
#
# Prerequisite:
#
# * Declare all deployment branches in `ALL_DEPLOYMENT_BRANCHES`
# * Declare deploy only branches in `DEPLOY_ONLY_BRANCHES` (ie, does not merge master)
# * Modify `Deploy.command` function as necessary
#
@michaelminter
michaelminter / index.html
Created September 20, 2012 01:14
Splash page template
<header class="main-header">
<hgroup class="main-headings">
<h1 class="main-heading">Fact: Better buttons increase app installs.</h1>
<h2 class="sub-heading">Thousands of people use Growify's appstore badges (free) and SMS app install buttons" (<a href="/pricing" class="header-link">see pricing</a>)</h2>
</hgroup>
<a href="/create-account" class="button button-blue button-large try-it-free">Get the code for your site »</a>
<p class="no-credit-card-required">No obligation.</p>
</header>
<section class="content">
<aside class="slider">
@michaelminter
michaelminter / git-colors.md
Created October 1, 2012 00:35
Colors in git

Bored with just black and white in your git status? Add some colour!

Open up your global Git configuration file (it should be found in ~/.gitconfig) and enter this into it:

[color]
  ui = auto
[color "branch"]
  current = yellow reverse
  local = yellow

remote = green

<a class="button" href="#openModal">Open it up!</a>
<div id="openModal" class="modalbg">
<div class="dialog">
<a href="#close" title="Close" class="close">X</a>
<h2>Holy Crap!!!</h2>
<p>You freakin' did it!</p>
<p>You opened up the freakin' modal window! Now close it, ya dingus.</p>
<p class="fineprint">Based on the article "Creating a modal window with HTML5 & CSS3" at <a href="webdesignerdepot.com">Webdesigner Depot</a></p>
<p class="fineprint">p.s. Sorry for calling you a dingus earlier.</p>
@michaelminter
michaelminter / keywords.rb
Last active December 22, 2015 06:18
Create Keywords from content
# gem install Sanitize
require 'Sanitize'
def generate_keywords(content)
# strip HTML tags
content = Sanitize.clean content
# dump content into array and remove short words
words = content.scan /[A-Za-z0-9]{3,}/