Skip to content

Instantly share code, notes, and snippets.

View bit-dragon's full-sized avatar
🏠
Working from home

Jorge García bit-dragon

🏠
Working from home
View GitHub Profile
find ./ -name filename | xargs sed -i 0 "s/original/replace/g"
@bit-dragon
bit-dragon / post.html
Created June 7, 2012 19:55
Plugin to truncate and add an anchor "read more" in the posts of jekyll
<div class="">
<div class="entry">
<h2 class="title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
<div class="byline">Escrito el {{ post.date | date:"%d/%m/%Y" }}</div>
<div class="body">
{% if hide_extended %}
{% if post.readmore %}
{{ post.content | truncate }}
<a href="{{ post.url }}/#more" class="more-link"><span class="readmore">Read more»</span></a>
@bit-dragon
bit-dragon / gist:2870549
Created June 4, 2012 20:04
Basic structure of Jekill
all: install
install:
@echo Installing the basic structure
@mkdir -p _includes _layouts _posts _site
@touch _layouts/default.html _layouts/post.html
@touch _posts/2007-10-29-why-every-programmer-should-play-nethack.md
@touch _posts/2009-04-26-barcamp-boston-4-roundup.md
@touch index.html _config.yml
@echo Done
@bit-dragon
bit-dragon / nav-list-bootstrap.rb
Created May 2, 2012 01:25
simple-navigation render for twitter bootstrap nav-list and divider
#require 'simplenavigation'
class ListBootstrap < SimpleNavigation::Renderer::Base
def render(item_container)
list = item_container.items.inject([]) do |list, item|
if item.html_options[:opts]
if item.html_options[:opts][:nav_header]
list << li_header(item)
elsif item.html_options[:opts][:divider]
list << li_divider(item)
elsif item.html_options[:opts][:icon]