I hereby claim:
- I am pzi on github.
- I am pzi (https://keybase.io/pzi) on keybase.
- I have a public key whose fingerprint is FF3F 1C96 C62C 6000 5271 96A6 E99A 9CE4 AB53 A92F
To claim this, I am signing this object:
#= require jquery | |
#= require jquery-sort | |
$locationsContainer = $('#locations') | |
locationsData = $locationsContainer.data('locations') | |
currentCoords = latitude: 0, longitude: 0 | |
locations = [] | |
firstRun = true | |
if typeof (Number::toRad) is 'undefined' |
helpers do | |
# Acts as a thin wrapper for image_tag and generates a srcset attribute for regular image tags | |
# for usage with responsive images, supports middleman's asset_path helper. | |
# | |
# image_set_tag 'pic_1980.jpg', { 'pic_640.jpg' => '640w', 'pic_1024.jpg' => '1024w', 'pic_1980.jpg' => '1980w' }, sizes: '100vw', class: 'my-image' | |
# | |
# => <img src="/assets/ants_1980.jpg" srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w" sizes="100vw" class="my-image"> | |
# | |
def image_set_tag(source, srcset = {}, options = {}) | |
srcset = srcset.map { |src, size| "#{asset_path(:images, src)} #{size}" }.join(', ') |
I hereby claim:
To claim this, I am signing this object:
helpers do | |
def nav_active(url) | |
if (url.instance_of? String) | |
current_resource.url == url_for(url) ? {class: "active"} : {} | |
elsif (url.instance_of? Array) | |
url.map { |url| url_for(url) }.include?(current_resource.url) ? {class: "active"} : {} | |
else | |
{} | |
end | |
end |
# How to create a valid ID to use | |
# 1. Go to www.twitter.com and sign in as normal, go to your settings page. | |
# 2. Go to "Widgets" on the left hand side. | |
# 3. Create a new widget for what you need eg "user timeline" or "search" etc. | |
# 4. Feel free to check "exclude replies" if you dont want replies in results. | |
# 5. Now go back to settings page, and then go back to widgets page, you should | |
# see the widget you just created. Click edit. | |
# 6. Now look at the URL in your web browser, you will see a long number like this: | |
# 345735903485048478 | |
# 7. Use this as your WIDGET_ID below instead! |
<?php | |
// This file would be inside functions.php or a custom filter plugin that get's imported into functions.php | |
// Added custom validation for minimum character count of a textfield | |
// 4 refers to the form id | |
// 6 refers to the field id in that form | |
// 10 refers to priority the filter has (WP related) | |
// 4 again is an additional parameter for gform, in this case, the id of the form the target field belongs to | |
add_filter("gform_field_validation_4_6", "validate_input_length", 10, 4); |
$test_icons-sprite-map: sprite-map("some-icons/*.png") | |
$test_icons-sprite-names: sprite-names($test_icons-sprite-map) | |
@each $name in $test_icons-sprite-names | |
.some-icon-#{$name} | |
@include sprite-dimensions($test_icons-sprite-map, $name) |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://npmjs.org/install.sh | sh |
npm install -g yo
yo webapp
npm install grunt-contrib-jade --save-dev
= link_to 'Download 1', download_path(:symbol1_name) | |
= link_to 'Download 2', download_path(:symbol2_name) |