Skip to content

Instantly share code, notes, and snippets.

View olivoil's full-sized avatar

Olivier Melcher olivoil

View GitHub Profile
@olivoil
olivoil / keybase.md
Created April 29, 2018 17:31 — forked from webframp/keybase.md
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
# Unzip
unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@olivoil
olivoil / gist:773f7d1b6b441f0faf92070f2e2d0ac3
Created April 18, 2017 02:22 — forked from jansanchez/gist:ce5b0ca1c5e538f4b266
How to install NVIDIA video drivers in Elementary OS
@olivoil
olivoil / uustats.js
Created October 18, 2013 02:01 — forked from akdubya/uustats.js
(function(uustats){
uustats.sdev = function(series) {
return Math.sqrt(uustats.variance(series));
};
uustats.variance = function(series) {
var t = 0, squares = 0, len = series.length;
for (var i=0; i<len; i++) {
// http://www.w3.org/TR/dom/
// http://updates.html5rocks.com/2012/02/Detect-DOM-changes-with-Mutation-Observers
// https://developer.mozilla.org/en-US/docs/DOM/MutationObserver
var MutationObserver = (function () {
var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']
for(var i=0; i < prefixes.length; i++) {
if(prefixes[i] + 'MutationObserver' in window) {
return window[prefixes[i] + 'MutationObserver'];
}
}
@olivoil
olivoil / Custom.css
Last active December 15, 2015 14:59 — forked from nixpulvis/Custom.css
body { -webkit-transform: rotate(10deg); }
body { -webkit-animation: blur 30s infinite; }
img { -webkit-transform: rotate(180deg); }
body, p, body p, body div p { font-family: 'Comic Sans MS', cursive !important; }
p:before { content: "YOLO "; }
p:nth-child(2) { display:none !important; }
#-webkit-web-inspector { -webkit-transform:rotate(180deg); }
#-webkit-web-inspector .toolbar-item.close-left { display:none !important; }
html { -webkit-animation: rainbow 8s infinite; }
@-webkit-keyframes blur {
<html>
<head>
<script type="text/javascript" charset="utf-8">
var FB = function(){
//defaults and accessors
var initialized = false,
loggedIn = null,
shouldSucceed = true,
uid = '12345';
@olivoil
olivoil / example.rb
Created October 25, 2012 20:48 — forked from joakimk/example.rb
A simple form object built on top of virtus.
class Filter
include FormObject
# Proc because Date.yesterday changes every day :)
attribute :from, Date, default: Proc.new { Date.yesterday }
attribute :to, Date, default: Proc.new { 1.month.from_now - 1.day }
end
# in controller
@filter = Filter.new(params[:filter])
if Rails.env.production?
Braintree::Configuration.environment = Rails.env.staging? ? :sandbox : :production
Braintree::Configuration.merchant_id = ENV["braintree_merchant_id"]
Braintree::Configuration.public_key = ENV["braintree_public_key"]
Braintree::Configuration.private_key = ENV["braintree_private_key"]
else
Braintree::Configuration.environment = :sandbox
Braintree::Configuration.merchant_id = "<super secret>"
Braintree::Configuration.public_key = "<super secret>"
Braintree::Configuration.private_key = "<super secret>"