Skip to content

Instantly share code, notes, and snippets.

Nícolas Iensen nicolasiensen

Block or report user

Report or block nicolasiensen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View drt-server-openapi.yml
openapi: 3.0.2
version: 0.0.1
title: Rideshare API
description: |
The Rideshare API provides access to the rideshare service runned by [door2door](
# Environments
This API can be consumed in two different environments, staging and production.
View my-gist
nicolasiensen / test-material-ui-event-simulation.js
Created Dec 20, 2016
Simulating events with Jest and Material UI
View test-material-ui-event-simulation.js
// Simulating clicks
const dashboardMount = mount(
<Dashboard />, {
context: { muiTheme },
childContextTypes: { muiTheme: React.PropTypes.object }
const menuButton = ReactDOM.findDOMNode(dashboardMount.find(AppBar).find(IconButton).find('button').node)
View extendComponentWithMUITheme.js
// This helper is required to test any component that renders material-ui components.
// If you are getting a message saying:
// 'undefined is not an object (evaluating this.context.muiTheme.prepareStyles)'
// you should use this helper.
// The usage is simple, you pass a component class to extendComponentWithMUITheme
// and it will return a new component class capable of rendering material-ui
// components
// const MyExtendedComponent = extendComponentWithMUITheme(MyComponent)
View create_view_facts.rb
class CreateViewFacts < ActiveRecord::Migration
def up
create_view :facts, "
SELECT, c.created_at,, c.description_html,, c.mobilization_id, 'campaigns' as relname FROM campaigns c
SELECT, p.created_at,, p.description as description_html,, p.mobilization_id, 'problems' as relname FROM problems p;"
def down
drop_view :facts
nicolasiensen / gist:6196787
Created Aug 9, 2013
Distance between two geospatial points in MySql
View gist:6196787
SET @orig_lat = "50";
SET @orig_lng = "5";
SET @dest_lat = "45";
SET @dest_lng = "30";
SELECT 3956 * 2 * ASIN(SQRT( POWER(SIN((@orig_lat - @dest_lat) * pi()/180 / 2), 2) + COS(@orig_lat * pi()/180) * COS(@dest_lat * pi()/180) * POWER(SIN((@orig_lng - @dest_lng) * pi()/180 / 2), 2) ));
nicolasiensen / .bash_profile
Last active Dec 16, 2015
My .bash_profile
View .bash_profile
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
export PATH="/usr/local/bin:$PATH"
export PS1="\[\e[1;29;42m\]\w\$(parse_git_branch_and_add_brackets)\[\e[m\] "
export CLICOLOR=1
View .vimrc
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'wincent/Command-T.git'
Bundle 'bbommarito/vim-slim.git'
Bundle 'digitaltoad/vim-jade.git'
Bundle 'pangloss/vim-javascript.git'
Bundle 'vim-ruby/vim-ruby.git'
Bundle ''
nicolasiensen / game.rb
Last active Dec 14, 2015
Ordering games by achievements completeness
View game.rb
# by @diogob
def self.by_completeness user"
CASE WHEN (SELECT count(*) FROM achievements a WHERE a.game_id = = 0 THEN 0 ELSE
achievements_users au
JOIN achievements a ON = au.achievement_id
WHERE a.game_id = AND au.user_id = #{})::numeric /
(SELECT count(*)
View index.html
<title>ao vivo </title>
<!--JS JW6-->
<script type="text/javascript" src="" ></script>
<script type="text/javascript">jwplayer.key = "ZfKOArQz+u1vxoCkwM9cihPjTUoVodJwgUCFZRpZLis=";</script>
<div id="dPlayer">
<div class="dTitulo_video"></div>
You can’t perform that action at this time.