Skip to content

Instantly share code, notes, and snippets.


Fabien Penso penso

View GitHub Profile
penso /
Last active Dec 13, 2020
# Based on Loren finding
# From
find() {
{ LC_ALL=C command find -x "$@" 3>&2 2>&1 1>&3 | \
grep -v -e 'Permission denied' -e 'Operation not permitted' >&3; \
[ $? = 1 ]; \
} 3>&2 2>&1
View gist:e11513b346b99063068ce01bf4ab0af4
#!/usr/bin/env ruby
class Float
def floor2(exp = 0)
multiplier = 10 ** exp
((self * multiplier).floor).to_f/multiplier.to_f
no_vat_price = 1.00
View gist:4b7c7f28992c106691e6
Insert in ~/Library/LaunchAgents/com.vmware.appcatalyst.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
View gist:8c054b13c19123574bc1
2015-05-10T08:33:06.341Z 17056 TID-3lork WARN: /home/deploy/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:185:in `lock'
/home/deploy/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:185:in `mon_enter'
/home/deploy/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:209:in `mon_synchronize'
/data/www/faast/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:271:in `active_connection?'
/data/www/faast/shared/bundle/ruby/2.1.0/gems/activerecord-4.0.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:293:in `with_connection'
/data/www/faast/releases/20150509081300/app/worker/rss_parser_worker.rb:8:in `perform'
/data/www/faast/shared/bundle/ruby/2.1.0/gems/sidekiq-3.3.3/lib/sidekiq/processor.rb:75:in `execute_job'
/data/www/faast/shared/bundle/ruby/2.1.0/gems/sidekiq-3.3.3/lib/sidekiq/processor.rb:52:in `block (2 levels) in process'
/data/www/faast/shared/bundle/ruby/2.1.0/gems/sidekiq-3.3.3/lib/sidekiq/middleware/chain.rb:127:in `blo
View gist:a5b6b022d60db6f366ca
1) Users::RegistrationsController should create a new user
Failure/Error: expect(assigns(:user).send(key)).to eq(key)
expected: :first_name
got: "cum"
(compared using ==)
@@ -1,2 +1,2 @@
penso / Vagrantfile
Last active Jun 15, 2019
Vagrantfile for my local Rails development
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
penso / gist:39eccc756e3efe9ab84c
Last active Aug 29, 2015
How to sync icloud coredata?
View gist:39eccc756e3efe9ab84c
2 Devices A and B, they both receive a push notification at the same time,
which triggers a fetch of an object on a remote server, and store the content
inside a coredata icloud enabled DB. The object has a PID stored on the remote
You end up with 2 entries: one fetched on the remote server, one synced
from the other device through coredata sync.
Both devices have different NSManagedID for the same entries (you can't
automatically remove the most recent one based one it), the only thing you
penso / Link removal request
Last active Aug 29, 2015
Karrimor asks me to add a nofollow attribute to a link to their website I've included in a blog post I did. Would love to have your comment on that request, why would they ask this?
View Link removal request
View gist:cbcf3101daed0bef8ef2
<link href="http://ton_url_perso" rel="author" />
<meta content="@processone" name="twitter:site" />
<meta content="http://static..../image.jpg" name="twitter:image" />
<meta content="1100" name="twitter:image:width" />
<meta content="1093" name="twitter:image:height" />
<meta content="689541045" property="fb:admins" />
<meta content="Sea Beyond 2014" property="og:title" />
<meta content="Sea Beyond is a technical event that explores the future of real-time technologies. This year we focus on mobile chat and push notifications." property="og:description" />
View gist:863c1f6ab2ea6af864a4
class Foo
def initialize
@callbacks = {}
def on(type, &block)
@callbacks[type] = block
def callback(type, *args)