Skip to content

Instantly share code, notes, and snippets.

View aitor's full-sized avatar
👊
Working!

Aitor García Rey aitor

👊
Working!
View GitHub Profile
@glarrain
glarrain / connect-heroku-app-to-postgres-rds-with-ssl.md
Last active January 4, 2023 14:01 — forked from jonyt/connect_heroku_to_amazon_rds
How to connect a Heroku application to an Amazon RDS PostgreSQL instance, forcing SSL and certificate chain verification

1 - Download the RDS certificates (root plus region-specific intermediate ones) bundle:

wget -O config/rds-combined-ca-bundle.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

2 - Add config/rds-combined-ca-bundle.pem to the repository and redeploy to Heroku.

3 - Update the DATABASE_URL env var:

@ramiroaznar
ramiroaznar / index.html
Last active May 6, 2017 17:45
How to add a formula, histogram & category widget to a dashboard using deepinsights.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Deep-Insights.js | Highest Mountains</title>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<meta name=viewport content="width=device-width initial-scale=1">
<link rel="stylesheet" href="http://libs.cartocdn.com/di.js/v0/themes/css/deep-insights.css" />
<script src=" http://libs.cartocdn.com/di.js/v0/deep-insights.uncompressed.js"></script>
<style type="text/css">
# usage: combine-tracks.sh input.mov output.mov
#
# I've been using this ffmpeg command to take recordings made with ecamm's Call Recorder for Skype and uploading them
# to YouTube for transcription. I found that YouTube would only transcribe one of the audio channels which
# was often my own voice, which made it less than useful, to put it mildly. Once the channels are combined YouTube will
# transcribe both sides of the conversation. I also found that it was useful to adjust the volumes of the tracks.
ffmpeg -i $1 -filter_complex "[0:a:0]volume=0.781250[a1];[0:a:1]volume=0.781250[a2]; [a1][a2]amerge[out]" -map 0:v -map "[out]" -c:v copy -shortest $2
@arfon
arfon / big_query_examples.md
Last active September 19, 2022 13:00
BigQuery Examples for blog post

How many times shouldn't it happen...

-- https://news.ycombinator.com/item?id=11396045

SELECT count(*)
FROM (SELECT id, repo_name, path
        FROM [bigquery-public-data:github_repos.sample_files]
 ) AS F
@craigplummer
craigplummer / Gemfile
Last active February 21, 2022 08:43
Azure AD API Auth Setup
gem 'jwt', '~> 1.5.0'
gem 'warden', '~> 1.2.0'
@lopspower
lopspower / README.md
Last active April 25, 2024 12:17
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@121onto
121onto / 20160307172445_change_paperclip_attachment_path.rb
Created March 7, 2016 18:26
Example migration for changing paperclip storage path
class MoveAttachmentsToNewLocation < ActiveRecord::Migration
def initialize(name = self.class.name, version = nil)
access_key = Rails.application.secrets.g3_access_key_id
secret_key = Rails.application.secrets.g3_secret_access_key
storage = Fog::Storage::Google.new google_storage_access_key_id: access_key,
google_storage_secret_access_key: secret_key
@bucket_name = Rails.application.secrets.g3_bucket
@bucket = storage.directories.get(@bucket_name)
super(name, version)
@jarednorman
jarednorman / webpack-rails-1.markdown
Last active May 13, 2020 18:24
Webpack with Rails Part 1

Webpack with Rails Part 1

I don't like Sprockets, but it's the easiest and best choice for lots of Ruby on Rails projects. When looking for a better way to manage my JavaScript assets and an improved developer story, my current tool of choice is webpack. While I wish Rails supported drop-in asset pipelines the way that Phoenix does, it's not hard to use webpack with Rails.

@rosswd
rosswd / laptops.md
Last active March 30, 2023 15:46
Linux Laptops

Intercom user_hash

Remember that your secret key should never be exposed to the public

  • So Javascript code below should only be used for testing unless modified and used to run on a server