Skip to content

Instantly share code, notes, and snippets.

sbounmy / bitcoin.svg
Created December 19, 2023 10:15
Generate a QRCode BIP 21 with Bitcoin logo at its center
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sbounmy / .env.production
Last active May 21, 2024 18:34
Files to deploy Rails 7 app with Kamal
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
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
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 () {
var sessionId = wixLocation.query.session_id;
sbounmy / api_Dockerfile
Last active May 21, 2018 08:09
FROM driftrock/heroku-cli:latest as heroku
FROM ruby:2.4-jessie
# 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:// --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
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() {
static: true,
locale: 'fr',
mode: "range",
altFormat: "d M",
altInput: true,
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 =`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 / 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;
// first name
$('.member_name').map(function(i, e) {
return e.text.split(' ')[0];
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 / gist:75b08c401e7957abe7a3
Created March 14, 2015 10:50
Ruby constant lookup
Document = 'hello'
class Question
class Animal
puts Question::Document
class Question