Skip to content

Instantly share code, notes, and snippets.

View benbonnet's full-sized avatar

Ben benbonnet

View GitHub Profile
@mixin timingFunctions($name) {
@if $name == 'easeInQuad' { @include vendor-prefix("transition-timing-function","cubic-bezier(0.550, 0.085, 0.680, 0.530)") }
@if $name == 'easeInCubic' { @include vendor-prefix("transition-timing-function","cubic-bezier(0.550, 0.055, 0.675, 0.190)") }
@if $name == 'easeInQuart' { @include vendor-prefix("transition-timing-function","cubic-bezier(0.895, 0.030, 0.685, 0.220)") }
@if $name == 'easeInQuint' { @include vendor-prefix("transition-timing-function","cubic-bezier(0.755, 0.050, 0.855, 0.060)") }
@if $name == 'easeInSine' { @include vendor-prefix("transition-timing-function","cubic-bezier(0.470, 0.000, 0.745, 0.715)") }
@if $name == 'easeInExpo' { @include vendor-prefix("transition-timing-function","cubic-bezier(0.950, 0.050, 0.795, 0.035)") }
@if $name == 'easeInCirc' { @include vendor-prefix("transition-timing-function","cubic-bezier(0.600, 0.040, 0.980, 0.335)") }
@if $name == 'easeInBack' { @include vendor-prefix("transitio
@benbonnet
benbonnet / page_repositionner.coffee
Last active August 29, 2015 13:57
Page repositionner
########################
###### PLUGINS #########
########################
# scroll stops
$.fn.scrollStopped = (callback) ->
$(this).scroll ->
self = this
$this = $(self)
clearTimeout $this.data("scrollTimeout") if $this.data("scrollTimeout")
/Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/motion-bundler/require/ripper/builder.rb:9:in `read': No such file or directory - etc.so (Errno::ENOENT)
from /Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/motion-bundler/require/ripper/builder.rb:9:in `initialize'
from /Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/motion-bundler/require/ripper.rb:36:in `new'
from /Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/motion-bundler/require/ripper.rb:36:in `block in parse'
from /Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/motion-bundler/require/ripper.rb:32:in `each'
from /Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/motion-bundler/require/ripper.rb:32:in `parse'
from /Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/motion-bundler/require/ripper.rb:67:in `block in parse'
from /Users/yeahman/.rvm/gems/ruby-2.0.0-p353/gems/motion-bundler-0.2.1/lib/
@benbonnet
benbonnet / gist:9737518
Created March 24, 2014 10:03
rmotion crash
Assertion failed: (product_version != nil), function start_debug_server, file deploy.m, line 550.
rake aborted!
Command failed with status (): [XCODE_DIR="/Applications/Xcode.app/Content...]
/Library/RubyMotion/lib/motion/project/template/ios.rb:202:in `block in <top (required)>'
/Users/stagiaire/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/Users/stagiaire/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => device
(See full trace by running task with --trace)
@benbonnet
benbonnet / montage.sh
Created March 24, 2014 21:09
montage (but not a real montage)
convert 1.jpg 2.jpg 3.jpg 4.jpg 5.jpg 6.jpg 7.jpg 8.jpg 9.jpg 10.jpg 11.jpg 12.jpg -geometry x500 +append -gravity South a.png
@benbonnet
benbonnet / shars.rake
Created March 31, 2014 08:46
shares.rake
require 'csv'
namespace :count do
task :shares => :environment do
CSV.open("#{Rails.root}/shares.csv", "wb") do |csv|
csv << ["title", "lang", "url", "twitter","facebook","google+"]
Post.published.reverse.each do |p|
["fr","en"].each do |lang|
begin
puts title = p["title_#{lang}"]
lang = lang
before_validation :smart_url_field
protected
def smart_url_field
["website","facebook_url","twitter_url","soundcloud_url"].each do |check|
self["#{check}"] = "http://#{self["#{check}"]}" unless self["#{check}"][/\Ahttp:\/\//] || self["#{check}"][/\Ahttps:\/\//] || !self["#{check}"].presence
end
end
@benbonnet
benbonnet / SassMeister-input.scss
Created April 16, 2014 13:10
Generated by SassMeister.com.
// ----
// Sass (v3.3.5)
// Compass (v1.0.0.alpha.18)
// ----
#newsletter_mail{ overflow: hidden;
.box{ overflow: hidden; margin-bottom: 0px; }
#newsletter_header{ text-align: center;margin-top:20px;
#newsletter_logo{
img{ width: 300px; }
2.0.0-p353 :060 > u = User.where("user_type = 2").first; puts u.id; nil
User Load (0.8ms) SELECT `users`.* FROM `users` WHERE (user_type = 2) ORDER BY users.created_at DESC LIMIT 1
673
=> nil
2.0.0-p353 :061 > test_artist = u.artists.first; puts test_artist.id; nil
Artist Load (0.6ms) SELECT `artists`.* FROM `artists` WHERE `artists`.`user_id` = 673 ORDER BY artists.created_at DESC LIMIT 1
162
=> nil
2.0.0-p353 :062 > test_user = test_artist.user; puts test_user.id; nil
User Load (0.5ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 673 ORDER BY users.created_at DESC LIMIT 1
.fancybox-wrap,
.fancybox-skin,
.fancybox-outer,
.fancybox-inner,
.fancybox-image,
.fancybox-wrap iframe,
.fancybox-wrap object,
.fancybox-nav,
.fancybox-nav span,
.fancybox-tmp {