Skip to content

Instantly share code, notes, and snippets.

View thbar's full-sized avatar

Thibaut Barrère thbar

View GitHub Profile

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@thbar
thbar / config.js
Last active August 29, 2015 14:20 — forked from goyox86/config.js
/*
Graphite Required Variables:
(Leave these unset to avoid sending stats to Graphite.
Set debug flag and leave these unset to run in 'dry' debug mode -
useful for testing statsd clients without a Graphite server.)
graphiteHost: hostname or IP of Graphite server
graphitePort: port of Graphite server
@thbar
thbar / README.md
Last active August 29, 2015 14:21 — forked from mtowers/README.md

Description

A Dashing widget for displaying a graph of metrics data from Librato

Dependencies

httparty

Add it to dashing's gemfile:

#encoding: utf-8
# This HACK imports SEPA Mandates from a CSV file to
# Crédit Agricole SEPA System via their HTML API. :)
#
# Good luck with this!
#
require 'mechanize'
require 'virtus'
@thbar
thbar / up-and-running-with-edeliver-on-do.md
Created January 29, 2016 22:40 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
@thbar
thbar / README.md
Created April 28, 2016 20:01 — forked from joakimk/README.md
CircleCI elixir build example

This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.

We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.

It should be generic enough to work on any elixir app using mix.

If you have a elixir_buildpack.config, then enable that section in the build script to keep versions in sync!

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@thbar
thbar / gist:db63116c7d734a565b1161ed0b894949
Created October 6, 2016 12:38 — forked from alehmann/gist:316522
rubyrep / postgres: syncing tables with circular foreign key constraints
psql postgres -c "create database circular_fkeys_left"
psql circular_fkeys_left <<EOS
create table foos(id integer primary key, bar_id integer);
create table bars(id integer primary key, foo_id integer);
insert into foos(id, bar_id) values(1, 5);
insert into bars(id, foo_id) values(5, 1);
alter table foos add constraint bar_fk foreign key(bar_id) references bars;
alter table bars add constraint foo_fk foreign key(foo_id) references foos;
EOS
@thbar
thbar / wordpress_importer.rb
Created February 14, 2017 13:37 — forked from stammy/wordpress_importer.rb
Import a WordPress database and generate markdown files for Jekyll
# View my Jekyll blog http://paulstamatiou.com and my jekyll migration post http://paulstamatiou.com/how-to-wordpress-to-jekyll/
#
#
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'
@thbar
thbar / gist:f66a28fbeddd84391663451236d30150
Created December 8, 2017 10:34 — forked from n00neimp0rtant/gist:9515611
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname