Skip to content

Instantly share code, notes, and snippets.

View LauraBeatris's full-sized avatar
🌟

Laura Beatris LauraBeatris

🌟
View GitHub Profile
@podotki
podotki / tipsi-stripe.d.ts
Created June 19, 2020 12:47
Typings for tipsi-stripe library corresponding to 8.0.0-beta.10 version
declare module 'tipsi-stripe' {
export interface StripeOptions {
publishableKey: string
merchantId?: string
androidPayMode?: string
}
export type AccountHolderType = 'company' | 'individual'
export type PaymentMethodAddress = {
@stolinski
stolinski / Example.tsx
Last active June 8, 2022 05:54
Route Transitions with Framer Motion
const FakeComponent = () => {
return (
<AnimatedRoutes exitBeforeEnter initial={false}>
<RouteTransition exact path="/some-route">
<NewUsers />
</RouteTransition>
<RouteTransition exact path="/yo" >
<Users />
</RouteTransition>
</AnimatedRoutes>
@maykbrito
maykbrito / Adonis-ACL.md
Created August 12, 2019 10:08
Basic step-by-step to use ACL in AdonisJS

Install

adonis install adonis-acl

Config

app.js

@jukkatupamaki
jukkatupamaki / 20190417131115_test-setup.ts
Last active June 21, 2023 07:03
How to use Knex.js in a TypeScript project
import { Knex } from 'knex'
export async function up(knex: Knex): Promise<any> {
await knex.schema.createTable('test_setup', (table: Knex.TableBuilder) => {
table.integer('foobar');
});
}
export async function down(knex: Knex): Promise<any> {
await knex.schema.dropTable('test_setup');
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@jcollado
jcollado / email.js
Last active April 3, 2024 15:21
Send email with nodemailer and AWS SES (API or STMP)
var nodemailer = require('nodemailer');
var sesTransport = require('nodemailer-ses-transport');
var smtpPassword = require('aws-smtp-credentials');
var mailOptions = {
from: 'from@example.com',
to: 'to@example.com',
text: 'This is some text',
html: '<b>This is some HTML</b>',
};
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.