NOTE: This code now has it's own repo! Visit: http://github.com/jakebellacera/paginator
A lightweight paginator script. It currently uses Prototype.js, but will be framework-agnostic in future releases.
// The Function | |
function dateToUnix($time) { | |
return date('U', strtotime($time)); | |
} | |
// Example: | |
// We need to convert a simple string to a UNIX timestamp. | |
$sampleDate = '9/15/2010 05:30'; |
/** | |
* Content Formatting | |
* ================== | |
* Sensible formatting for formatted content. | |
* gist: http://gist.github.com/1150500 | |
*/ | |
/* Setting a default font */ | |
.content { font: 13px/1.5em sans-serif; } |
#-webkit-web-inspector #toolbar { | |
background: #cdcdcd !important; | |
height: 36px !important; | |
} | |
#-webkit-web-inspector #main { | |
top: 36px !important; | |
} | |
#-webkit-web-inspector .toolbar-item.elements:hover:after { | |
content: "elements"; | |
z-index: 9999; |
NOTE: This code now has it's own repo! Visit: http://github.com/jakebellacera/paginator
A lightweight paginator script. It currently uses Prototype.js, but will be framework-agnostic in future releases.
<?php | |
function cmb_opt_groups( $args, $defaults, $field_object, $field_types_object ) { | |
// Only do this for the field we want (vs all select fields) | |
if ( '_cmb_option_field' != $field_types_object->_id() ) { | |
return $args; | |
} | |
$option_array = array( | |
'Group 1' => array( |
# useful nginx configuration for reverse proxy with Apache | |
# edit lines 8, 11, and 30 | |
# taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/ | |
# edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com) | |
server { | |
listen 80; | |
server_name domain.com *.domain.com; # edit this to your domain |
UPDATE: Please see some of the forks for an updated version of this guide. I | |
myself have moved onto the Rails 3.1 betas to get the asset pipeline. But if | |
you want to stay on stable there are other folks who are keeping this guide | |
relevant despite the changes constantly occurring on Sprockets 2. The comments | |
on this gist will lead you to the right forks. :) | |
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
This stuff will be native in Rails 3.1 and the layout of the files on the |
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL | |
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew | |
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it | |
gem install bundler | |
# 1. Get edge Rails source (master branch) | |
git clone https://github.com/rails/rails.git |
// 1. Go to page https://www.linkedin.com/settings/email-frequency | |
// 2. You may need to login | |
// 3. Open JS console | |
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)) | |
// 4. Copy the following code in and execute | |
// 5. No more emails | |
// | |
// Bookmarklet version: | |
// http://chengyin.github.io/linkedin-unsubscribed/ |
Let's say you're a web developer who happens to work with both MAMP and Ruby when building different types of websites. Let's say you also like to keep your MySQL stuff in one place and don't like having to juggle both a local MySQL install as well as a MAMP MySQL install. Well, you can indeed connect your ruby apps to MAMP's MySQL. Here's a tutorial on how to do it.
Important! Before you do anything, download and install MAMP. MAMP Pro will work as well. At the time of this writing, MAMP 2.1.1 is the latest.
brew install rbenv
, follow any instructions homebrew gives you after the installation is complete.