Skip to content

Instantly share code, notes, and snippets.

View Gaurav2728's full-sized avatar
🏠
Working from home

Gaurav Sharma Gaurav2728

🏠
Working from home
View GitHub Profile
@Gaurav2728
Gaurav2728 / history.txt
Created July 14, 2012 16:13 — forked from unak/history.txt
The History of Ruby
* 原則として安定版のリリースのみを列挙し、特に重要と思われる非安定版のリリースを「not stable」として記載した。
* 各リリースの出所となったブランチを明記し、またそれらのブランチの発生時期も示した。なおリポジトリのSubversion化前はtrunkという用語は使われていないが、混乱を避けるために統一した。また、ruby_1_8_7ブランチは事故のために1.8.7リリース後にv1_8_7タグから切り直されている。
* 全国規模あるいは全世界規模(?)のイベントを参考のために記載した。開催地は英語圏で通用していると思われる表記を採用した。
* 1.2.1はrepackと称して2回目のリリースが行われた。他にも同様の例があるが、それらは日付が変わっていないので記載していない。
* 1.0は大量に日付つきでリリースされたので途中は割愛した。
* 各安定版系列の最終バージョンには「final」と記載した。なお、1.4系列についてはオフィシャルには終了のアナウンスはないが、終了している旨の非公式な言及は散見されるため既に終了しているとみなした。
1993-02-24 (start)
1995-12-21 0.95 (not stable; first public release)
1996-12-25 1.0-961225 (from trunk)
@Gaurav2728
Gaurav2728 / VdbeIntExtract.h
Created October 20, 2012 06:36 — forked from mattrco/VdbeIntExtract.h
Selected attributes of struct Vdbe from VdbeInt.h
struct Vdbe {
sqlite3 *db; /* The database connection that owns this statement */
Op *aOp; /* Space to hold the virtual machine's program */
Mem *aMem; /* The memory locations */
Mem **apArg; /* Arguments to currently executing user function */
Mem *aColName; /* Column names to return */
Mem *pResultSet; /* Pointer to an array of results */
int nMem; /* Number of memory locations currently allocated */
int nOp; /* Number of instructions in the program */
VdbeCursor **apCsr; /* One element of this array for each open cursor */
require 'test_helper'
class RedemptionCodeTest < ActiveSupport::TestCase
def setup
@business = businesses :vinovolo
@business.enabled_reward_back = true
@user = users :warren
@user.punchh_app = punchh_apps :vinovolo
end
@Gaurav2728
Gaurav2728 / ml-ruby.md
Created May 9, 2016 07:59 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

Resources for Machine Learning in Ruby

Gems

@Gaurav2728
Gaurav2728 / lets-encrypt-nginx.md
Created June 4, 2017 12:05 — forked from padde/lets-encrypt-nginx.md
Let's Encrypt with Nginx

Let's Encrypt with Nginx

Here's how I set up a tiny Nginx/Rails server that uses HTTPS via a Let's Encrypt issued certificate.

https://letsencrypt.paddd.de/

Server

I use the smallest DigitalOcean droplet (512 MB) here, which is built from the "Ubuntu Ruby on Rails on 14.04" image provided by them.

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@Gaurav2728
Gaurav2728 / psqlfix.txt
Created January 25, 2018 16:51
Change postgres default template0 to UTF8 encoding
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@Gaurav2728
Gaurav2728 / notify_slack.rb
Created May 17, 2018 16:12 — forked from seancdavis/notify_slack.rb
Post incoming webhook to Slack using Ruby
# Assumes:
# - curl is installed
# - you have a slack channel with an incoming webhook configured
require 'json'
def notify_slack(webhook_url, channel, username, text, image)
payload = {
:channel => channel,
:username => username,

Keybase proof

I hereby claim:

  • I am gaurav2728 on github.
  • I am gaurav2728 (https://keybase.io/gaurav2728) on keybase.
  • I have a public key ASBBEQN2hrMTS5LRF_x76wLLJPALDOW5Bh6cRjtPM4hgXQo

To claim this, I am signing this object:

@Gaurav2728
Gaurav2728 / MySQL_5-7_macOS.md
Created December 6, 2018 08:18 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.