Skip to content

Instantly share code, notes, and snippets.

View hooopo's full-sized avatar
🍏
I may be slow to respond.

Hooopo hooopo

🍏
I may be slow to respond.
View GitHub Profile
@hooopo
hooopo / gist:547a4219ea2bfe926395
Created November 11, 2015 07:47 — forked from prellele/gist:1825744
Using StartSSL Certs with Nginx-Webserver

NOTE: You can check, if your config here:
http://www.sslshopper.com/ssl-checker.html

Decrypt the private key using the password you entered when you created your key:
openssl rsa -in ssl.key -out /etc/nginx/conf/ssl.key

Protect your key from prying eyes:
chmod 600 /etc/nginx/conf/ssl.key

@hooopo
hooopo / osx-10.9-setup.md
Last active September 10, 2015 15:48 — forked from kevinelliott/osx-10.9-setup.md
Clean Install – Mac OS X 10.9 Mavericks

Mac OS X 10.9 Mavericks

Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

@hooopo
hooopo / Dockerfile
Last active September 3, 2015 14:40 — forked from fran0x/Dockerfile
Dockerfile for Greenplum SNE 4.2.6.1
FROM centos:6.6
MAINTAINER "Francisco Lopez" teraflopx@gmail.com
# update & upgrade packages
RUN yum update -y & yum upgrade -y
# install extra packages and basic tools (included some required for Greenplum installer)
RUN yum install -y epel-release git unzip which tar sed wget curl nano expect
# cleanup packages
# Standalone script to try http://rom-rb.org/ with a database
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rom'
gem 'rom-sql'
gem 'rom-rails'
gem 'activemodel'
SELECT
cohorts.first_action,
cohorts.last_action,
COUNT(cohorts.id) AS user_count
FROM (SELECT
MIN(DATE(created_at - INTERVAL (DAYOFWEEK(created_at) - 1) DAY)) AS first_action,
MAX(DATE(created_at - INTERVAL (DAYOFWEEK(created_at) - 1) DAY)) AS last_action,
user_id AS id
FROM daily_activity_events
GROUP BY user_id) AS cohorts
require 'benchmark'
d1 = [1,1,1,1,0,0,0,0,0]
d2 = [1,0,1,0,1,1,0,0,0]
d3 = [0,0,0,0,1,0,1,1,1]
def calc_sim vector1, vector2
//Macro
function(){
var ecommerceData = {
'ecommerce':{
'purchase':{
'actionField': {
'products': [
'id':'Omnijoin Pro',

ruby-1.9.3-p484 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p484 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

ruby-install -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/01-zero-broken-tests.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/02-railsexpress-gc.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/03-display-more-detailed-stack-trace.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/04-show-full-backtrace-on-stack-overflow.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/05-fix-missing-c-return-event.patch ruby 2.0.0-p353