Skip to content

Instantly share code, notes, and snippets.

View CharlyPoppins's full-sized avatar
🖖
Longue vie et prospérité

Charly Poppins CharlyPoppins

🖖
Longue vie et prospérité
View GitHub Profile
@nandorojo
nandorojo / eas-update-sentry.ts
Last active January 11, 2024 02:03
EAS Update + Sentry Source Maps
import { getConfig } from '@expo/config'
import fs from 'fs'
import spawnAsync from '@expo/spawn-async'
import chalk from 'chalk'
import path from 'path'
const appDir = process.cwd()
console.log()
console.log(chalk.green('Sentry source maps script. Working directory:'))
@mindlapse
mindlapse / guide.md
Last active September 7, 2021 15:05
A guide on how to use PaymentIntents with tipsi-stripe

Introduction

Card payments with Stripe should be performed with PaymentIntents.

This API was created to handle modern payments, where the cardholder's bank may require the user to authenticate themselves with the bank before a payment can be authorized.

Authentication requirements first started to appear with European banks regulated by PSD2 which introduced [Strong Customer Authentication

@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@PierreLebedel
PierreLebedel / DateTimeFrench.php
Created January 5, 2017 10:42
PHP DateTime in french language
<?php
class DateTimeFrench extends DateTime {
public function format($format='j M Y'){
$days_full = array(
'Monday' => 'Lundi',
'Tuesday' => 'Mardi',
'Wednesday' => 'Mercredi',
'Thursday' => 'Jeudi',
@dblencowe
dblencowe / SilexServerValetDriver.php
Created September 8, 2016 14:52
A Laravel Valet Driver for running Silex installations
<?php
class SilexServerValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@jasperkuperus
jasperkuperus / DiscriminatorListener.php
Last active July 7, 2023 17:35
This gist shows you how to define your discriminator maps at child level in doctrine 2. Why? Because your parent class shouldn't be aware of all it's subclasses. Please read my article for more explanation: https://medium.com/@jasperkuperus/defining-discriminator-maps-at-child-level-in-doctrine-2-1cd2ded95ffb
<?php
namespace My\Namespace;
/**
* This Listener listens to the loadClassMetadata event. Upon this event
* it hooks into Doctrine to update discriminator maps. Adding entries
* to the discriminator map at parent level is just not nice. We turn this
* around with this mechanism. In the subclass you will be able to give an
* entry for the discriminator map. In this listener we will retrieve the
* load metadata event to update the parent with a good discriminator map,
@amfeng
amfeng / index.php
Last active August 8, 2022 19:33
Stripe OAuth Example -- PHP
<?php
define('CLIENT_ID', 'YOUR_CLIENT_ID');
define('API_KEY', 'YOUR_API_KEY');
define('TOKEN_URI', 'https://connect.stripe.com/oauth/token');
define('AUTHORIZE_URI', 'https://connect.stripe.com/oauth/authorize');
if (isset($_GET['code'])) { // Redirect w/ code
$code = $_GET['code'];