Skip to content

Instantly share code, notes, and snippets.

@jpfinlay
jpfinlay / ubuntu-16.04LTS-Rails-5.2-Ruby-2.5.1.md
Last active July 27, 2018 07:29
Git 2.18 / OhMyZSH / Rbenv / Ruby 2.5.1 / Rails 5.2 / Postgres 9.5.13

Ubuntu 16.04LTS with Rails 5.2, Ruby 2.5.1 and PostgeSQL 9.5.13

July 26, 2018

Install pre-requisites and Git (2.18.0)

$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt install git-core zsh autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev -y
$ sudo apt-add-repository ppa:git-core/ppa && sudo apt-get update && sudo apt-get install git -y 

Create .gitconfig

@gabbork
gabbork / .vimrc
Last active November 10, 2017 18:21
My vim configuration on macOS Sierra, mainly used for python3
" memo: howto install everything
" 1. you have python3, vim and brew already installed
" 2. install Vundle: https://github.com/VundleVim/Vundle.vim
" 3. install flake8 with: pip3 install flake8
" 4. install your favourite plugins with https://vimawesome.com and use this ~/.vimrc config file
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
@amolkhanorkar
amolkhanorkar / PG::Error: ERROR: new encoding (UTF8) is incompatible
Last active November 29, 2023 17:57
Postgres PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
@linrock
linrock / stockfish.rb
Last active December 25, 2015 07:34
A simple ruby client for the Stockfish chess engine.
require 'open3'
module Stockfish
class InvalidCommand < StandardError; end
class InvalidOption < StandardError; end
class Engine
attr_reader :stdin, :stdout, :stderr, :wait_threads, :version, :pid
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@Gregg
Gregg / gist:968534
Created May 12, 2011 13:54
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
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)

/**
IMPORTANT: Requires this version of jquery
until 1.3.3 comes out http://gist.github.com/186325
ALSO: This is very dirty still and has not been
abstracted for use. It is just solving our immediate problems.
Use cases that must pass (and should be tested someday):
* Clicking on links updates layout
* Click around a bit and then use back/forward buttons