Skip to content

Instantly share code, notes, and snippets.

View denmarkin's full-sized avatar

Den Markin denmarkin

  • Rev.com, Inc
  • Carlsbad, CA
View GitHub Profile
@denmarkin
denmarkin / _ahah_render.php
Created December 24, 2010 21:31
Extended version of http://www.nicklewis.org/node/967 recipe for partial nested form update
// Lastly, here's a help function pulled from Nick Lewis's blog to alter the form
// see: http://www.nicklewis.org/node/967
// Nested fields are implemented by denmarkin.
// Usage example: $output .= _ahah_render($form, array('block_settings', 'module_block_'.$delta, 'custom_fields'));
function _ahah_render($fields, $name) {
$form_state = array('submitted' => FALSE);
$form_build_id = $_POST['form_build_id'];
// Add the new element to the stored form. Without adding the element to the
@denmarkin
denmarkin / deploy.rb
Created January 9, 2011 13:52
Example capistrano receipe with bells and whistles. See for details/supported features: http://denmarkin.tumblr.com/post/2667677553/capistrano-receipe-with-bells-and-wistles
set :application, "myapp"
# github stuff
set :repository, "git@github.com:exampleAcc/myapp.git"
set :scm, :git
set :scm_username, "github_id"
set :scm_passphrase, "github_password"
set :branch, "dev"
set :git_enable_submodules, 1
!!! 5
/[if lt IE 7] <html lang="en" class="no-js ie6">
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
%meta{:charset => "utf-8"}/
/
Always force latest IE rendering engine (even in intranet) &amp; Chrome Frame
@denmarkin
denmarkin / .ackrc
Created February 9, 2011 18:01
~/.ackrc for web-developers. I'm using AckMate
--type-add=ruby=.haml,.rake,.feature
--type-add=objc=.pch
--type-set=xcode=.pbxproj,.pbxuser,.perspectivev3
--type-set=ragel=.rl
--type-set=nib=.xib
--type-set=plist=.plist
--type-set=tmstuff=.tmproj,.tm_build_errors
--type-set=ignorables=.log,.tmp,.pdf
--noignorables
--nonib
@denmarkin
denmarkin / deploy.rb
Created February 9, 2011 20:07 — forked from mdominiak/deploy.rb
simple deploy recipe for passenger
set :application, "new-vegas"
set :repository, "git@github.com:mdominiak/new-vegas.git"
set :scm, :git
set :host, "newvegas.vault106.com"
set :user, "deploy"
set :use_sudo, false
set :deploy_to, "/home/deploy/new-vegas/production"
role :web, host
### RAILS SHORTCUT GLORY
#
# printf "\033[0m0 All attributes off\033[0m\n"
# printf "\033[1m1 Bold\033[0m\n"
# printf "\033[4m4 Underline\033[0m\n"
# printf "\033[5m5 Blink\033[0m\n"
# printf "\033[7m7 Invert\033[0m\n"
# printf "\033[8m8 Hide\033[0m8 = Hide\n"
# printf "\033[30m30 Black\033[0m30 = Black\n"
@denmarkin
denmarkin / Twitter REE GC environment settings
Created February 23, 2011 20:52 — forked from bryanl/Twitter REE GC environment settings
Twitter REE GC environment settings
RUBY_HEAP_MIN_SLOTS=500000
RUBY_HEAP_SLOTS_INCREMENT=250000
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
RUBY_GC_MALLOC_LIMIT=50000000
@denmarkin
denmarkin / 37singals REE GC environment
Created February 23, 2011 20:51 — forked from bryanl/37singals REE GC environment
37singals REE GC environmen
RUBY_HEAP_MIN_SLOTS=600000
RUBY_GC_MALLOC_LIMIT=59000000
RUBY_HEAP_FREE_MIN=100000
@denmarkin
denmarkin / new_company_notification.feature
Created March 11, 2011 20:05
Example email testing cucumber feature
Feature: Notify admin when new company added
In order to manage registration
As an admin
I want to be notified by email about new company added
Scenario: Notify admin about new company
Given they have no companies
When they create company titled MailChimp
Then I should receive an email with subject "Please moderate company ExampleInc"
When I open the email with subject "Please moderate company ExampleInc"
@denmarkin
denmarkin / sass.rb
Created March 29, 2011 19:36
Rails 3 initializer for Heroku/SASS setup
# see http://forrst.com/posts/Setting_up_SASS_on_Heroku-4dZ
# You can put this in config/initializers/sass.rb
# Setup directory in tmp/ to dump the generated css into
require "fileutils"
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "generated"))
# Tell SASS to use the .sass files in public/stylesheets/sass and
# output the css to tmp/stylesheets/generated