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;
}
@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">
<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,}/
irb -Ilib -rGEMNAME
@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
#
@jwicks
jwicks / sidekiq-worker-cloudwatch-queue-size.rb
Last active November 21, 2019 07:14
Sidekiq worker for publishing queue size metric to AWS CloudWatch
class QueueSizeMetricWorker
include Sidekiq::Worker
include Sidetiq::Schedulable
recurrence { minutely }
sidekiq_options retry: false
# Publish a custom metric on CloudWatch with the Sidekiq queue size
def perform
cloudwatch = Aws::CloudWatch::Client.new(
@zulhfreelancer
zulhfreelancer / readline_bundle_image_not_found.md
Last active November 3, 2021 20:50
How to fix 'readline.bundle image not found' problem?

If you get error like this:

Running via Spring preloader in process 7662
/Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require': dlopen(/Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
  Referenced from: /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
  Reason: image not found - /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
@miwahall
miwahall / jquery-bootstrap-datepicker.css
Created October 17, 2013 17:10
jQuery UI Datepicker Bootstrap 3 Style
.ui-datepicker {
background-color: #fff;
border: 1px solid #66AFE9;
border-radius: 4px;
box-shadow: 0 0 8px rgba(102,175,233,.6);
display: none;
margin-top: 4px;
padding: 10px;
width: 240px;
}
@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.