Skip to content

Instantly share code, notes, and snippets.

Avatar

JP Boily jipiboily

View GitHub Profile
@jipiboily
jipiboily / radio-buttons-as-buttons.html
Last active Jul 4, 2018
Bulma: radio buttons as buttons
View radio-buttons-as-buttons.html
<div class="control field m-t-md radio-buttons-as-buttons">
<label class="label" for="goal_short_or_long_term">Court ou long terme?</label>
<label class='button'>
<input type="radio" value="short_term" name="goal[short_or_long_term]" id="goal_short_or_long_term_short_term" />
Court
</label>
<label class='button'>
<input type="radio" value="medium_term" name="goal[short_or_long_term]" id="goal_short_or_long_term_medium_term" />
Moyen
@jipiboily
jipiboily / badge.html
Created Apr 3, 2017
Metrics Watch badge
View badge.html
<center>
<a href="https://metricswatch.com/"><img src="https://metricswatch.com/wp-content/uploads/2016/12/metricswatch-logo-horizontal-1.png" alt="Metrics Watch"></a>
<br>
is helping us with Google Analytics.
</center>
@jipiboily
jipiboily / private.xml
Created Mar 19, 2015
Disable stupid buttons on Logitech R800 remote with Karabiner
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>Disable useless shit (for Logitech remote)</name>
<identifier>private.logitech_remote_disable_shit</identifier>
<autogen>__KeyToKey__ KeyCode::DOT</autogen>
<autogen>__KeyToKey__ KeyCode::ESCAPE</autogen>
<autogen>__KeyToKey__ KeyCode::F5</autogen>
</item>
</root>
View gist:e075e3a220672434e61f
class Fourchette::Heroku
def copy_pg from, to
end
end
@jipiboily
jipiboily / snippet.cson
Last active Aug 29, 2015
Playing with Atom snippets
View snippet.cson
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
View not_rescued.rb
trace = TracePoint.new(:raise) do |trace|
puts trace.raised_exception if "IT WAS NOT RESCUED"
end
trace.enable
@jipiboily
jipiboily / dokku_pg_etc.sh
Last active Dec 20, 2015
Bootstrap script for Dokku + postgres 9.1. Also creates a .pgpass and creates a database
View dokku_pg_etc.sh
# Tested on Ubuntu 13.04 x64
# You need to set those environment variables
#```
# export DATABASE_USER=username_here
# export DATABASE_PASSWORD=password_here
# export DATABASE_NAME=database_name_here
# export DATABASE_ROOT_PASSWORD=database_root_password
# ```
# ON SERVER
@jipiboily
jipiboily / migration.rb
Created May 9, 2013
Migration for a model that does not exist in the app
View migration.rb
class MyMigrationForSomething < ActiveRecord::Migration
class Monologue::PostsRevision < ActiveRecord::Base
end
def up
Monologue::PostsRevision.reset_column_information # This might not be necessary, but you know it exists if needed! :)
# do your stuff here...
end
def down
@jipiboily
jipiboily / gist:4960321
Last active Dec 13, 2015
Worst answer in a ticket that I opened to say I was not able to answer another ticket...
View gist:4960321
Your reported issue has been fixed. I have noticed that the subject line of the ticket
#X "Invoice for your Y account"...but why? was causing the issue while updating the ticket.
Currently, I have changed the subject line of the ticket #X from "Invoice for your Y account"...but why?
to 'Invoice for your account'. Now you should be able to update/close the mentioned ticket without any issue.
I suggest you not to use ant special charterers like -, “, and ? in the subject line of the ticket.
@jipiboily
jipiboily / output_sample.txt
Last active Dec 10, 2015
RSpec: top failing specs report
View output_sample.txt
------------------------------------------------
Top failing specs
------------------------------------------------
18 | ./spec/models/my_model_spec.rb
4 | ./spec/models/your_failing_model_spec.rb