Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View drnic's full-sized avatar
🏆
Platinum Status Level

Dr Nic Williams drnic

🏆
Platinum Status Level
View GitHub Profile
version: "3.2"
services:
dev:
image: tianon/true
restart: "no"
depends_on:
- db
- redis
db:
@drnic
drnic / schema_dumper.rb
Last active February 6, 2024 16:01
Our rails db includes our own tables/schema and the Salesforce/Heroku Connect schema (under "salesforce.*"). We place this file in config/initializers/schema_dumper.rb and now our rails db:schema:dump includes both our own tables and the salesforce. tables.
# This solution was based on https://gist.github.com/GlenCrawford/16163abab7852c1bd550547f29971c18
Rails.configuration.to_prepare do
ActiveRecord::SchemaDumper.ignore_tables = %w[
salesforce._hcmeta
salesforce._sf_event_log
salesforce._trigger_log
salesforce._trigger_log_archive
]
end
class ApplicationReflex < StimulusReflex::Reflex
before_reflex do
jwt = ShopifyApp::JWT.new(element.data_jwt) # pass in "Bearer: blah"
if jwt
self.headers = {"jwt.shopify_domain" => jwt.shopify_domain, "jwt.shopify_user_id" => jwt.shopify_user_id}
end
end
end
web: ./bin/rackup -p "$PORT"
@drnic
drnic / Gemfile
Last active October 9, 2020 12:29
gem "google-id-token"
@drnic
drnic / AlignmentWidget.vue
Last active July 6, 2020 10:42
Vue component for some alignment buttons. Demo at https://share.getcloudapp.com/2Nu5bL1B
<template>
<span class="p-1 inline-flex items-center rounded-lg bg-gray-200">
<button
@click="alignmentSelected = 'left'"
:class="alignmentSelected == 'left' ? 'bg-white shadow' : 'hover:bg-gray-400'"
class="p-1 rounded-lg"
>
<svg class="h-6 w-6 text-gray-200" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 333 333">
<path
stroke="currentColor"
git clone https://gist.github.com/drnic/a042bd719ed9213c5af7fd1605f8bf93 ~/workspace/pipeline.bk-run-docker-fail
cd ~/workspace/pipeline.bk-run-docker-fail

bk run pipeline.bk-run-docker-fail.yml -E AGENT_ENV=where-is-this-env

The output should include the two lines:

@drnic
drnic / Procfile
Last active February 9, 2020 01:03
Deploy https://jupyter.org/ Jupyter Lab to Cloud Foundry
web: jupyter lab --ip 0.0.0.0 --port $PORT --no-browser
{
"drnic": {"joined": 2012},
"bob": {"joined": 2020}
}
$ kaf generate-secret.yaml
$ k get secret my-internal-secret -n kubecf -ojsonpath='{.data.password}' | base64 --decode
CDVIqCF7LY6dLyEGq10BrzaZfRWGDl8dxSV4vuVz8eDGga8AoP84SEc22Ben25mM

Now rotate secret:

$ kaf rotate-my-internal-secret.yaml