Skip to content

Instantly share code, notes, and snippets.

View msevestre's full-sized avatar

Michael Sevestre msevestre

View GitHub Profile
@osdiab
osdiab / generate-all-translations.ts
Last active September 14, 2022 11:53
Type Safe remix-i18next
// this script reads through app/locales/*/*.json, copies them to public/locales,
// and generates a typescript file that can be used for making nice typings.
// it can be extended in the future to actually read the contents to allow for
// typesafe interpolation of variables.
import { join, relative } from "node:path";
import { cp, rm, writeFile } from "node:fs/promises";
import { promisify } from "node:util";
import { glob } from "glob";
import camelCase from "camelcase";
@cjavilla-stripe
cjavilla-stripe / webhooks.tsx
Created March 25, 2022 13:11
Handle Stripe webhooks in Remix
import Stripe from 'stripe'
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY)
export const action = async ({request}) => {
const secret = 'whsec_...' // process.env.WEBHOOK_SIGNING_SECRET
const sig = request.headers.get('stripe-signature')
let event;
const payload = await request.text()
@jgoux
jgoux / app.js
Created April 15, 2014 14:53
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@gitaarik
gitaarik / git_submodules.md
Last active May 4, 2024 11:10
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')