Skip to content

Instantly share code, notes, and snippets.

Avatar
💜
Join me! Twitch is hiring!

Mark Cerqueira markcerqueira

💜
Join me! Twitch is hiring!
View GitHub Profile
View Gerrit helpers
## Gerrit is dumb ##
####################
alias gerrit='ssh -p 29418 <wherever you run gerrit> gerrit'
# Usage #
# gerritIds <project>
# will list all change ids by you that are open for <project>
# useful to find what ids will will be abandoned by abandonALl
gerritIds() {
gerrit query --format=JSON --patch-sets -- status:open project:$1 | grep -v runTimeMilliseconds | grep -E "`git config user.email`" | grep -E -o '"number":"\d\d+"' | tr '"' ' ' | cut -d' ' -f4-
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active Dec 3, 2020
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@jkubicek
jkubicek / .git-completion.sh
Created Mar 13, 2013
Git tab completion script
View .git-completion.sh
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
View unique-bash-history.sh
HISTCONTROL="erasedups"
export HISTCONTROL
@josephwecker
josephwecker / new_bashrc.sh
Created Aug 11, 2012
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
View new_bashrc.sh
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
@mikeygee
mikeygee / 01-before.html
Created May 7, 2012
truncate blog posts in jekyll
View 01-before.html
<!-- using the truncate filter -->
{% for post in site.posts limit:10 %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span>
{% if post.content.size > 2000 %}
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node -->
<a href="{{ post.url }}">read more</a>
{% else %}
{{ post.content }}
{% endif %}
@ilkka
ilkka / archivegenerator.rb
Created Nov 20, 2010
Jekyll archive page generator plugin
View archivegenerator.rb
module Jekyll
class ArchiveGenerator < Generator
safe true
def generate(site)
collate_by_month(site.posts).each do |month, posts|
page = ArchivePage.new(site, month, posts)
site.pages << page
end
end
@ilkka
ilkka / archivepage.rb
Created Nov 19, 2010
Jekyll ArchivePage class
View archivepage.rb
module Jekyll
class ArchivePage
include Convertible
attr_accessor :site, :pager, :name, :ext, :basename, :dir, :data, :content, :output
# Initialize new ArchivePage
# +site+ is the Site
# +month+ is the month
# +posts+ is the list of posts for the month
You can’t perform that action at this time.