Skip to content

Instantly share code, notes, and snippets.

View mickey's full-sized avatar

Michael Bensoussan mickey

View GitHub Profile
### Keybase proof
I hereby claim:
* I am mickey on github.
* I am mickeyben (https://keybase.io/mickeyben) on keybase.
* I have a public key ASAMLI13WijX3byEVs_4bbGefvph2wvSeO3nSVB8E9GEGAo
To claim this, I am signing this object:
SELECT w.service_class, CASE w.service_class
WHEN 6 THEN 'etl'
WHEN 7 THEN 'data'
WHEN 8 THEN 'viz'
WHEN 9 THEN 'default'
END,
e.exec_50th, e.exec_75th, e.exec_95th, e.exec_99th,
q.queue_50th, q.queue_75th, q.queue_95th, q.queue_99th,
m.mem_50th, m.mem_75th, m.mem_95th, m.mem_99th
FROM stl_wlm_query w
@mickey
mickey / active_record_json_spec.rb
Created May 1, 2017 21:56
ActiveRecord patches for partial SPATIAL and JSON support in MySQL
require "spec_helper"
describe ActiveRecord::Type::JSON do
class TestJSON < ActiveRecord::Base
end
before do
connection = ActiveRecord::Base.connection
if connection.table_exists?(:test_jsons)
connection.drop_table(:test_jsons)
#!/usr/bin/env ruby
# <bitbar.title>Brew Services</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Adam Lindberg</bitbar.author>
# <bitbar.author.github>eproxus</bitbar.author.github>
# <bitbar.desc>Shows and manages Homebrew services.</bitbar.desc>
# <bitbar.image>http://i.imgur.com/hVfhHYP.jpg</bitbar.image>
# <bitbar.dependencies>ruby, brew, brew-services</bitbar.dependencies>

Instructions: solve the levels in ascending order, and send your code and data at guillemette@drivy.com when you’re done. We love SQL tricks, but we also value your ease to write code. You can use any langage you like as long as you have a strategy to deploy and maintain this code.

Goal: Provide the BI team a report of the occupancy rate of the fleet per city.

For a certain half-day, we define the occupancy rate as the nb of rented cars / nb of available cars.

For a half day T, a car is considered available by default. This default state can be changed to:

@mickey
mickey / gist:9073d274220e8684047a
Created November 28, 2014 17:17
WeightedSampler -> Randoms with weight
class WeightedSampler
def initialize(items)
@items = normalize(items)
end
def sample(num = nil)
return get_sample unless num
Array.new(num) { get_sample }
end
@mickey
mickey / Readme.md
Created September 4, 2013 13:23
Bugsnag unresolved issues widget for Dashing

##Description

Simple Dashing job to display total number of unresolved issues from BugSnag.

##Preview

##Dependencies

@mickey
mickey / Readme.md
Created September 4, 2013 11:05
Dashing widget to track the number of applications for the dashing widget challenge.
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-connect');
// Project configuration.
grunt.initConfig({
[
{
"keys": ["ctrl+alt+left"],
"command": "set_layout",
"args":
{
"cols": [0.0, 0.33, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
}