Skip to content

Instantly share code, notes, and snippets.

View marcospinello's full-sized avatar
🖖
Docs or it didn't happen

Marco Spinello marcospinello

🖖
Docs or it didn't happen
View GitHub Profile
@marcospinello
marcospinello / 0_reuse_code.js
Created June 13, 2014 08:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@marcospinello
marcospinello / jekyll_links_liquid_syntax
Last active October 21, 2015 17:22
Programmatically handle relative links in Jekyll using Liquid templating syntax
.
├── _config.yml
├── _drafts
| ├── begin-with-the-crazy-ideas.textile
| └── on-simplicity-in-technology.markdown
├── _includes
| ├── footer.html
| └── header.html
├── _layouts
| ├── default.html
@marcospinello
marcospinello / Time_to_read
Last active October 21, 2015 17:22
Reading time in Jekyll using Liquid templating
{% comment %}
source: https://sojourner.co/blog/code/time-to-read-post-jekyll.html
author: https://sojourner.co/
{% endcomment %}
{% capture count_words %}
2 {{ page.content | number_of_words }}
3 {% endcapture %}
4
5 {% capture time_words %}
@marcospinello
marcospinello / lightbox.rb
Created November 5, 2015 15:44 — forked from melborne/lightbox.rb
Jekyll Lightbox Image Plugin
# A Liquid tag for Jekyll sites that allows embedding Lightbox images.
# by: kyoendo
# Source URL: https://gist.github.com/4035604
#
# Example usage: {% lightbox 2012/abc.png, Title of Image, Alt Title %}
module Jekyll
class LightboxTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@marcospinello
marcospinello / jekyll.tag-cloud.rb
Created November 5, 2015 16:45 — forked from yeban/jekyll.tag-cloud.rb
Flexible, logarithmic distribution, tag cloud for Jekyll.
# Copyright (C) 2011 Anurag Priyam - MIT License
module Jekyll
# Jekyll plugin to generate tag clouds.
#
# The plugin defines a `tag_cloud` tag that is rendered by Liquid into a tag
# cloud:
#
# <div class='cloud'>
@marcospinello
marcospinello / tag_cloud_tag.rb
Created November 5, 2015 17:20 — forked from ilkka/tag_cloud_tag.rb
Jekyll tag cloud / tag pages plugin
module Jekyll
class TagCloudTag < Liquid::Tag
safe = true
def initialize(tag_name, text, tokens)
super
end
def render(context)
html = ""
@marcospinello
marcospinello / pedantically_commented_playbook.yml
Created December 8, 2015 09:06 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@marcospinello
marcospinello / ruby_rails_windows.md
Created February 22, 2016 13:13 — forked from KelseyDH/ruby_rails_windows.md
Ruby on Rails Microsoft Windows Troubleshooting Tips

##Ruby on Rails Windows Troubleshooting Tips & Survival Guide

###Intro/Overview

The Ruby on Rails Windows Troubleshooting tips & Survival Guide is a random catalogue of issues I faced working with Ruby on Rails on Windows (Windows 7 specifically). This guide is not exhaustive, but covers many of the challenges that causes Windows Ruby developers to jump ship to Linux or Mac. If you're reading this guide then you're probably new to Ruby/Rails, so also included is more general beginner advice to help you get going.

####Personal Side Note

Before you follow this guide, I strongly recommend you consider using Linux or Mac OS X for Ruby Development instead. Reckless, and looking to prove a point; I ignored this strongly given advice while learning Ruby/Rails at a coding bootcamp. While I eventually did succeeed in getting Ruby on Rails to work in Windows, it was not easy, and I easily lost 40+ hours on StackOverFlow to Windows/Ruby configuration issues--time I could have devoted to lear

@marcospinello
marcospinello / robots.txt
Created April 11, 2016 07:20 — forked from budparr/robots.txt
Jekyll Robots page to exclude from robots pages that are excluded from the sitemap
---
layout: null
permalink: robots.txt
---
# filter pages and documents for the noindex key
{% assign noindexPages = site.pages | where: 'sitemap', false %}
{% assign noindexDocuments = site.documents | where: 'sitemap', false %}
User-agent: *
# robotstxt.org - if _config production variable is false robots will be disallowed.
{% if site.production != true %}