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 November 9, 2024 17:31
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 August 15, 2024 01:45
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 November 13, 2024 13:51
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: '[email protected]',
to: '[email protected]',
text: 'This is some text',
html: '<b>This is some HTML</b>',
};
@jbenet
jbenet / simple-git-branching-model.md
Last active November 9, 2024 04:55
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.