Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
🎶 around the world 🕺🎶

Philipe Fatio fphilipe

🌍
🎶 around the world 🕺🎶
View GitHub Profile
View stadtkreise.json
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 Mar 12, 2015
Unqualified function calls break postgres_fdw compatibiliy
View test.sh
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(
View index.html
<!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;
View keybase.md

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:

View gist:509369
def genitivize(name)
name.strip.sub(/(s)?$/i) { |s| s.downcase == 's' ? "#{s}’" : '’s' }
end
View update_chromium.sh
#!/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`
View output.txt
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 Sep 21, 2011
Easier access to assets in Rails 3.1
View assets.rb
# 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 Sep 23, 2011
rake assets:precompile without hitting the DB
View assets.rake
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
API Versioning and Inheritance
View gist:2658685
module API
module V1
class UsersController
def index
'v1'
end
def show
'v1'
end
end