Skip to content

Instantly share code, notes, and snippets.

@sbounmy
sbounmy / bitcoin.svg
Created December 19, 2023 10:15
Generate a QRCode BIP 21 with Bitcoin logo at its center
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sbounmy
sbounmy / .env.production
Last active May 21, 2024 18:34
Files to deploy Rails 7 app with Kamal
KAMAL_REGISTRY_PASSWORD=xxx
RAILS_MASTER_KEY=xxxxxxxxxxxxxxx
POSTGRES_PASSWORD=xxxxxxxxxxxxx
REDIS_PASSWORD=my-redis-password
REDIS_URL=redis://:my-redis-password@n28-redis:6379/1
INFO [2778830e] Running docker container ls --all --filter name=^healthcheck-n28-production-5fb8156f30048e8b974b661295947d2a60e75002$ --quiet | xargs docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}' on 128.140.109.106
INFO [2778830e] Finished in 0.234 seconds with exit status 0 (successful).
INFO [59db2e4d] Running docker container ls --all --filter name=^healthcheck-n28-production-5fb8156f30048e8b974b661295947d2a60e75002$ --quiet | xargs docker logs --tail 10000 2>&1 on 128.140.109.106
INFO [59db2e4d] Finished in 0.180 seconds with exit status 0 (successful).
ERROR D, [2023-10-25T10:45:55.753396 #7] DEBUG -- : (0.2ms) SELECT pg_try_advisory_lock(1958924183684115060)
D, [2023-10-25T10:45:55.754208 #7] DEBUG -- : ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
D, [2023-10-25T10:45:55.756245 #7] DEBUG -- : ActiveRecord::InternalMetadata Load (
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
import { getCustomer } from 'backend/stripe';
$w.onReady(async function () {
(function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
(t[a].q=t[a].q||[]).push(arguments)}})(wixWindow,'tap');
var sessionId = wixLocation.query.session_id;
@sbounmy
sbounmy / api_Dockerfile
Last active May 21, 2018 08:09
api/Dockerfile
FROM driftrock/heroku-cli:latest as heroku
FROM ruby:2.4-jessie
MAINTAINER Stephane BOUNMY <stephane@hackerhouse.paris>
# Install apt based dependencies required to run Rails as
# well as RubyGems. As the Ruby image itself is based on a
# Debian image, we use apt-get to install those.
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
@sbounmy
sbounmy / flatpickr.js
Last active August 16, 2017 21:52
Make flatpickr to work witgh squarespace lightbox
$(document).ready(function() {
// Static: true fixes when flatpickr is in lightbox
$('.lightbox-handle').on('click', function() {
$("#text-yui_3_17_2_1_1500409984147_44339-field").flatpickr({
static: true,
locale: 'fr',
mode: "range",
altFormat: "d M",
altInput: true,
@sbounmy
sbounmy / import.rake
Created March 23, 2017 15:35
Rake task to import production database from heroku mongodb
namespace :db do
desc "Import from production env"
task import: :environment do
raise 'this should be run in dev mode !!' unless Rails.env == 'development'
uri = Mongo::URI.new(`heroku config:get MONGODB_URI`.chomp)
tmp = Dir::Tmpname.make_tmpname('/tmp/', 'hh-dump')
puts "Dumping #{uri.servers[0]} to #{tmp}..."
`mongodump -h #{uri.servers[0]} -d #{uri.database} -u #{uri.credentials[:user]} -p #{uri.credentials[:password]} -o #{tmp}`
dev = Mongoid.clients['default']
@sbounmy
sbounmy / slack.js
Created October 27, 2016 14:24
js scrap slack users
// make sure youve scrolled all users on page
// Email
$('a[title~="Email"]').map(function(i, e) {
return e.text;
}).toArray().join('\n')
// first name
$('.member_name').map(function(i, e) {
return e.text.split(' ')[0];
@sbounmy
sbounmy / controllers.application.js
Last active August 29, 2015 14:28
injection to helpers
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@sbounmy
sbounmy / gist:75b08c401e7957abe7a3
Created March 14, 2015 10:50
Ruby constant lookup
Document = 'hello'
class Question
end
class Animal
puts Question::Document
end
class Question