Skip to content

Instantly share code, notes, and snippets.

View konung's full-sized avatar
💭
💙💛

Nick Gorbikoff konung

💭
💙💛
View GitHub Profile
@konung
konung / README.md
Created February 3, 2012 04:32 — forked from fnichol/README.md
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

# Update, upgrade and install development tools:
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
@konung
konung / Rakefile
Last active August 29, 2015 14:18 — forked from robhurring/Rakefile
task :environment do
require './dj-sinatra'
end
namespace :jobs do
desc "Clear the delayed_job queue."
task :clear => :environment do
Delayed::Job.delete_all
end
@konung
konung / ubuntu-install-ruby-1.8.7.sh
Created February 2, 2017 15:34 — forked from murphyslaw/ubuntu-install-ruby-1.8.7.sh
Install Ruby 1.8.7 with rbenv on Ubuntu
# Install system libraries.
sudo apt-get install zlib1g-dev openssl libssl-dev libreadline-dev git-core
# Install rbenv.
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Setup bash.
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@konung
konung / ree-1.8.7-2011.03
Last active February 2, 2017 16:40 — forked from fgrehm/ree-1.8.7-2011.03
ruby-build REE definitions for Ubuntu 12.04
build_package_patched() {
# These three patches are included when RVM builds REE
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
patch -p1 < no_sslv2.diff
cd ..
@konung
konung / how-to-squash-commits-in-git.md
Created February 8, 2018 18:01 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

module Shopify.Product.Model where
type alias Product =
{ created_at : String,
id : Int,
product_type : String,
published_at : String,
published_scope : String,
title : String,
updated_at : String,
# And, to activate, you need to tell Rails to load it up:
# config/application.rb
config.middleware.insert_before 0, Rack::Attack
@konung
konung / README.md
Last active July 26, 2018 23:31 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@konung
konung / 00_notes.txt
Created February 15, 2019 05:33 — forked from jwoertink/00_notes.txt
Our production deployment setup for deploying Lucky on to Elastic Beanstalk in production.
We develop locally on MacOS. Due to some issues with cross compilation, we build the crystal binary on docker locally,
then zip that up and ship that along with the docker stuff to elasticbeanstalk.