Skip to content

Instantly share code, notes, and snippets.

@annalee
annalee / sample-slack-coc.md
Last active Mar 22, 2021
A sample code of conduct for social slack teams.
View sample-slack-coc.md

[SLACKNAME] Code of Conduct

Welcome!

[BRIEF DESCRIPTION OF THE SLACK AND ITS PURPOSE]

The current admins are:

  • [NAMES]
@ericclemmons
ericclemmons / example.md
Last active May 7, 2021
HTML5 <details> in GitHub
View example.md

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
@glarrain
glarrain / connect-heroku-app-to-postgres-rds-with-ssl.md
Last active Mar 26, 2021 — 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
View connect-heroku-app-to-postgres-rds-with-ssl.md

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
How to add a formula, histogram & category widget to a dashboard using deepinsights.js
View index.html
<!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">
View combine-tracks.sh
# 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 May 2, 2021
BigQuery Examples for blog post
View big_query_examples.md

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
@lopspower
lopspower / README.md
Last active May 18, 2021
Hexadecimal color code for transparency
View README.md

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 Mar 7, 2016
Example migration for changing paperclip storage path
View 20160307172445_change_paperclip_attachment_path.rb
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
Webpack with Rails Part 1
View webpack-rails-1.markdown

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.

View Intercom user_hash.md

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