Skip to content

Instantly share code, notes, and snippets.

View terenceponce's full-sized avatar

Terence Ponce terenceponce

View GitHub Profile
@terenceponce
terenceponce / shufti.json
Created September 7, 2022 16:00
Shufti Callback for status change
{"reference"=>"a0372417-2529-485c-a231-74d1f87320b2",
"event"=>"verification.declined",
"country"=>nil,
"proofs"=>
{"document"=>
{"proof"=>
"https://api.shuftipro.com/storage/8WlU2XYXo2SjV5yGOPRBtczXag0OvHb1wskRTMPIZppIxRHBHHaQTYGIfHTsheyh/document/proof.png?access_token=a6eb4d75a06c2059ea9739076fb1a1765ddd1fe9",
"additional_proof"=>
"https://api.shuftipro.com/storage/8WlU2XYXo2SjV5yGOPRBtczXag0OvHb1wskRTMPIZppIxRHBHHaQTYGIfHTsheyh/document/additional_proof.png?access_token=a6eb4d75a06c2059ea9739076fb1a1765ddd1fe9"},
"address"=>
@terenceponce
terenceponce / keybase.md
Created November 8, 2019 03:26
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@terenceponce
terenceponce / bitcoin.conf
Last active August 27, 2018 03:48
Omnicore config
# /home/omnicore/.bitcoin/bitcoin.conf
# [core]
datadir=/mnt/volume-sgp1-01/Omnicore
dbcache=1024
txindex=1
# [rpc]
server=1
rpcuser=user
@terenceponce
terenceponce / ruby_example.rb
Created August 1, 2016 02:40
Looker embed integration
require 'cgi'
require 'securerandom'
require 'uri'
require 'base64'
require 'json'
require 'openssl'
module LookerEmbedClient
def self.created_signed_embed_url(options)
# looker options
@terenceponce
terenceponce / profile_management_spec.rb
Last active July 13, 2020 02:22
Creating Signed Cookies in Capybara
# spec/features/profile_management_spec.rb
require 'rails_helper'
feature 'Profile Management', type: :feature do
given!(:user) { create(:user) }
scenario 'User updates profile' do
cookie = SignedCookieGenerator.new(:auth, user.id)
page.driver.browser.set_cookie(cookie.to_s)
@terenceponce
terenceponce / curl1.sh
Created December 12, 2014 04:55
Resource Owner Credentials flow
curl -H “Content-Type: application/json" \
-d '{"client_id":"a11bbd9c339e6d8bd84368061089971398e23617d88a7c8dd060555b7cff1077","client_secret":"f079dadcca08a26d5967421f3849447e1e4519d6ba33cabdd4bdd0c86aebded3","grant_type":"password","username":"test@example.com","password":"passw0rd"}' /
-X POST http://localhost:3000/oauth/token
@terenceponce
terenceponce / Gemfile
Last active August 29, 2015 14:08
Creating an API with Rails, Doorkeeper, and Grape
source 'https://rubygems.org'
gem 'rails', '4.1.6'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
@terenceponce
terenceponce / application.html.gara
Created September 2, 2014 04:00
Gara / HAML comparison
content_for :content do
main(class: 'main-container', role: 'main') {
render 'shared/express_blog/sidebar'
div(class: 'content-body') {
render 'shared/express_admin/messages'
if content_for?(:page_header)
div(class: 'page-header') {
div(class: 'row') {
div(class: 'small-12 columns') {
yield :page_header
@terenceponce
terenceponce / default.conf
Last active August 29, 2015 14:02
Typical Rails nginx configuration
upstream zealous-badger {
server 127.0.0.1:49224;
}
server {
listen [::]:80;
listen 80;
server_name zealous-badger.example.com;
location / {
proxy_pass http://zealous-badger;
proxy_http_version 1.1;
@terenceponce
terenceponce / README.md
Last active January 2, 2019 04:02
Setting up rbenv, Ruby 2.1, Rails 4.1.0.beta1, nginx, Passenger, PostgreSQL 9.1 on Ubuntu 12.04 LTS for Windows Azure

Setting up Ruby, Rails, Nginx, Passenger, PostgreSQL 9 on Ubuntu 12.04 LTS for Windows Azure

Last updated: 12/31/2013

Fix the locale issue

  • Edit /etc/default/locale as sudo.
  • Append LC_ALL="en_US.UTF-8" at the end of the file, save and quit.
  • sudo locale-gen en_US en_US.UTF-8
  • sudo dpkg-reconfigure locales

Install the necessary packages to install rbenv and build Ruby