Skip to content

Instantly share code, notes, and snippets.

@azu
azu / README.md
Last active March 15, 2024 09:59
スタートアップ/企業の調べ方
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@udondan
udondan / Example: golang gorm postgres uuid relation.md
Last active April 25, 2024 17:50
Example: golang gorm postgres uuid relation

Example: golang gorm postgres uuid relation

I was trying forever to get autoloading relationships working with postgres 9.4 and gorm and primary keys of type uuid.

Many tutorials and examples, even those on the official docs were just not workiong or missing important details.

The program in this gist creates the table structure and inserts a nested record. A parent and a child object is created by simply creating the child, which holds the relation to a parent. The child element then is queried by ID. The returned object holds the nested parent object.

Used package versions:

@marians
marians / main.go
Created January 27, 2017 10:25
OAuth 2.0 authentication in a Golang CLI
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"net/url"
"time"
@mindscratch
mindscratch / aurora.md
Last active May 19, 2017 15:35
Build Aurora 0.7.1-SNAPSHOT on CentOS 6.5

Build Aurora 0.7.1-SNAPSHOT on CentOS 6.5

I created a CentOS 6.5 Droplet on Digital Ocean with 8GB RAM (you'll need at least 4 for the Java portion of the build), feel free to use any other CentOS 6.5 environment that you can have root on.

Prepare the Environment

First, Mesos 0.21.0+ requires subversion 1.8+ devel package which is not available by default by yum. Add a repo that has subversion-devel 1.8 available, i.e:

Add new repo /etc/yum.repos.d/wandisco-svn.repo, with:

@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@iainjmitchell
iainjmitchell / README.md
Last active May 29, 2019 14:20
BBC News Widget for Dashing

##Description Simple Dashing widget (and associated job) to display BBC News Stories.

##Dependencies nokogiri

Add it to dashing's gemfile:

gem 'nokogiri'
@marcelcaraciolo
marcelcaraciolo / linregr.py
Created October 28, 2011 03:43
linear regression
from numpy import loadtxt, zeros, ones, array, linspace, logspace
from pylab import scatter, show, title, xlabel, ylabel, plot, contour
#Evaluate the linear regression
def compute_cost(X, y, theta):
'''
Comput cost for linear regression
'''
#Number of training samples
@agramfort
agramfort / lowess.py
Last active August 16, 2023 06:19
LOWESS : Locally weighted regression
"""
This module implements the Lowess function for nonparametric regression.
Functions:
lowess Fit a smooth nonparametric regression curve to a scatterplot.
For more information, see
William S. Cleveland: "Robust locally weighted regression and smoothing
scatterplots", Journal of the American Statistical Association, December 1979,