Skip to content

Instantly share code, notes, and snippets.

Matthieu Varagnat mvaragnat

Block or report user

Report or block mvaragnat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mvaragnat
mvaragnat / gist:b9d0c8c74ca217743e0308e05050c84e
Created Mar 19, 2019 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database
View gist:b9d0c8c74ca217743e0308e05050c84e

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

View gist:5cacd8a9106c3e674527f93522c6ee59
Verifying my Blockstack ID is secured with the address 1JRag47EzD413oMdKLNhZWFsdafP5MMKwd https://explorer.blockstack.org/address/1JRag47EzD413oMdKLNhZWFsdafP5MMKwd
@mvaragnat
mvaragnat / gist:90de7abb2b9f1f352b6d0819c5283dae
Created Sep 5, 2017
Rails : How to compare (diff) to ActiveRecord models
View gist:90de7abb2b9f1f352b6d0819c5283dae
# Hash.diff is deprecated in Rails 5
# this method does not handle deep hashes (it could be made by recursion though)
class MyModel < ApplicationRecord
def diff(contract)
differences = {}
self.attributes.each do |k,v|
if contract[k] != v
differences[k] = {v => contract[k]}
end
View Passport Slack strategy
/*
This gist shows a modification of the basic Oauth2 Passport strategy, to be suitable for Slack platform
Module dependencies.
*/
var util = require('util')
var OAuth2Strategy = require('passport-oauth2').Strategy
/**
* `Strategy` constructor.
You can’t perform that action at this time.