This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
################### | |
# http://stackoverflow.com/questions/639647/git-and-asp-mvc | |
################### | |
# | |
################### | |
# compiled source # | |
################### | |
*.com | |
*.class | |
*.dll |
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with following layout - | |
<table class="table-fixed-header"> | |
<thead class="header"> | |
<tr> | |
<th>Column 1</th> | |
<th>Column 2</th> | |
<th>Column 3</th> |
## Hstore Method Missing Extension | |
module HstoreModel | |
def method_missing(method, *args, &block) | |
key = method.to_s.gsub('=','').to_sym | |
sym_options = options.symbolize_keys | |
if !self.class.attribute_methods_generated? | |
self.class.define_attribute_methods | |
if respond_to_without_attributes?(method) | |
send(method, *args, &block) |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
/* Dynamic Elements v1.0 | |
Show/hide, require/not require, and enable/disable fields based on checkboxes and select fields. | |
Class names: "lock" will disable an element, "hide" will hide an element, "need" will require an element. | |
Adding the ID of a checkbox as a class to an element will make it show/enabled/required: | |
i.e. <input type="checkbox" name="getName" id="getName" /> <input type="text" name="yourName" class="getName lock hide require" /> | |
Adding the ID and value of a select field as a class to an element will make it show/enabled/required (format is 'ID-Value'): | |
i.e. <select name="getTitle" id="getTitle"><option>Mr</option><option>Mrs</option><option>Other</option> <input type="text" name="yourTitle" class="getTitle-Other lock hide require" /> |
queue: ./queue.sh |
# Kill and restart nginx | |
function restart_nginx(){ | |
pids=$(pidof nginx) | |
if [[ -n $pids ]]; | |
then | |
sudo kill -9 $pids | |
sudo service nginx restart | |
fi | |
} |
worker_processes 1; | |
user nobody nogroup; | |
pid /tmp/nginx.pid; | |
error_log /tmp/nginx.error.log; | |
events { | |
worker_connections 1024; | |
accept_mutex off; | |
} | |
http { | |
default_type application/octet-stream; |
# Example of a DelayedJob that syncs info with mailchimp | |
class SyncMailchimp < Struct.new(:opts) | |
include Dobexer::ExceptionNotifier | |
def run_hominid(attempts = 0, &block) | |
attempts += 1 | |
block.call | |
rescue EOFError => e |