Skip to content

Instantly share code, notes, and snippets.

@cqpx
cqpx / google-protobuf.linux.md
Last active February 5, 2021 14:59 — forked from diegopacheco/google-protobuf.linux.md
How to Install Google Protocol Buffers on Ubuntu Linux 15.10?
sudo apt-get install -y git autoconf automake libtool curl make g++ unzip
git clone https://github.com/google/protobuf.git
cd protobuf/
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig # refresh shared library cache.
@cqpx
cqpx / hack.sh
Created March 17, 2014 22:51 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cqpx
cqpx / ms.js
Created December 21, 2011 04:00 — forked from rauchg/ms.md
Milliseconds conversion utility.
/**
# ms.js
No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`.
ms('2d') // 172800000
ms('1.5h') // 5400000
ms('1h') // 3600000
ms('1m') // 60000
@cqpx
cqpx / index.js.erb
Created December 17, 2011 03:08 — forked from ryanb/index.js.erb
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>