Skip to content

Instantly share code, notes, and snippets.

View fphilipe's full-sized avatar
🌍
🎶 around the world 🕺🎶

Philipe Fatio fphilipe

🌍
🎶 around the world 🕺🎶
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fphilipe
fphilipe / test.sh
Created March 12, 2015 02:06
Unqualified function calls break postgres_fdw compatibiliy
dropdb --if-exists postgis_test_1
dropdb --if-exists postgis_test_2
createdb postgis_test_1
createdb postgis_test_2
# Set up DB 1:
cat <<SQL | psql postgis_test_1
CREATE EXTENSION postgis;
CREATE VIEW test_geometry AS
SELECT ST_Distance(
<!DOCTYPE html>
<html>
<head>
<title>Scroll Snap &amp; Backdrop Filter</title>
<meta content='width=device-width, initial-scale=1.0' name='viewport' />
<style>
body {
margin: 0;
padding-top: 10vh;

Keybase proof

I hereby claim:

  • I am fphilipe on github.
  • I am philipe (https://keybase.io/philipe) on keybase.
  • I have a public key whose fingerprint is A081 196B 4236 5343 20B2 19EE F6F2 3962 F744 18A0

To claim this, I am signing this object:

def genitivize(name)
name.strip.sub(/(s)?$/i) { |s| s.downcase == 's' ? "#{s}’" : '’s' }
end
#!/bin/sh
#### CONFIG ################################
USE_OLD_ICON=true # replace the new simplified icon with the old one
APP_DESTINATION=/Applications/Chromium.app # where to put the app
SUPPORT_DIR="`dirname "$0"`/.support" # where the icon and version number will be stored
############################################
VERSION_FILE="$SUPPORT_DIR/chromium_version"
NEWEST_VERSION=`curl -s http://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/LAST_CHANGE`
Fixnum
user system total real
true
0.030000 0.000000 0.030000 ( 0.027810)
true
0.010000 0.000000 0.010000 ( 0.006959)
--------------------------------------------------
String
user system total real
true
@fphilipe
fphilipe / assets.rb
Created September 21, 2011 18:09
Easier access to assets in Rails 3.1
# coding: UTF-8
# A module to facilitate the retrieval of asset paths and urls in Rails 3.1.
module Assets
extend self
def url(file)
host + path(file)
end
@fphilipe
fphilipe / assets.rake
Created September 23, 2011 13:09
rake assets:precompile without hitting the DB
namespace :assets do
# Prepend the assets:precompile_prepare task to assets:precompile.
task :precompile => :precompile_prepare
# This task will be called before assets:precompile to optimize the
# compilation, i.e. to prevent any DB calls.
task 'precompile_prepare' do
# Without this assets:precompile will call itself again with this var set.
# This basically speeds things up.
ENV['RAILS_GROUPS'] = 'assets'
@fphilipe
fphilipe / gist:2658685
Created May 11, 2012 09:50
API Versioning and Inheritance
module API
module V1
class UsersController
def index
'v1'
end
def show
'v1'
end
end