Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hugobast on github.
  • I am hugobastien (https://keybase.io/hugobastien) on keybase.
  • I have a public key ASASRsYqL3692yxbYAqszCMaggXYtVrbGoIYMLsA_nrrmQo

To claim this, I am signing this object:

@hugobast
hugobast / destroyable.rb
Created November 28, 2014 15:21
Reform ActiveAdmin Extensions
module Form
module Destroyable
extend ActiveSupport::Concern
included do
# This is deprecated, what's the replacement?
property :_destroy, virtual: true
end
def new_record?
require_relative 'warning_suppressor'
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new app, phantomjs_logger: WarningSuppressor
end
@hugobast
hugobast / merge_dict.py
Created March 17, 2014 16:09
Merging dict
a_dict = {"a": 1, "b": 2, "c": 3}
another_dict = {"b": 3, "d": 4}
dict(a_dict, **another_dict)
# worth a read http://sahandsaba.com/thirty-python-language-features-and-tricks-you-may-not-know.html
@hugobast
hugobast / cypher.rb
Created June 15, 2012 01:54
Keychain
require 'gibberish'
class Keychain
module Cipher
@@secret = ""
def self.configuration
yield self
end
@hugobast
hugobast / helpers.coffee
Created June 15, 2012 01:44
CoffeeScript Parallax Scrolling
$.fn.translate = (x, y) ->
translate = "translate(#{x}px, #{y}px)"
this.css('-moz-transform', translate);
this.css('-o-transform', translate);
this.css('-ms-transform', translate);
this.css('-webkit-transform', translate);
this.css('transform', translate);
$.fn.translate3d = (x, y, z) ->
translate3d = "translate3d(#{x}px, #{y}px, #{z}px)"