No se necesita duplicar todo un script de PHP para solo comentar una funcion que no queremos que se llame.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Temporary wrapper for firebase functions until @sentry/serverless support is implemented | |
* It currently supports wrapping https, pubsub and firestore handlers. | |
* usage: https.onRequest(wrap((req, res) => {...})) | |
*/ | |
import type {Event} from '@sentry/types'; | |
import type {https} from 'firebase-functions'; | |
import type {onRequest, onCall} from 'firebase-functions/lib/providers/https'; | |
import type {ScheduleBuilder} from 'firebase-functions/lib/providers/pubsub'; | |
import type {DocumentBuilder} from 'firebase-functions/lib/providers/firestore'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stately.ai/viz/8cf34aba-b602-4f85-93d2-cc4c2d1f4c06 | |
import { createModel } from 'xstate/lib/model' | |
interface Fund { | |
label: string | |
$target: number | |
createdAt: Date | |
updatedAt: Date | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Source: https://emmanuelbernard.com/blog/2014/04/14/split-a-commit-in-two-with-git/ | |
### Split a commit in two for the busy onesPermalink | |
### Let’s see the sequence first before explaining it | |
git rebase -i <oldsha1> | |
# mark the expected commit as `edit` (replace pick in front of the line), save and close | |
git reset HEAD^ | |
git add ... | |
git commit -m "First part" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Random string based on /dev/urandom | |
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo; | |
tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1 | |
dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const express = require('express'); | |
const cookieParser = require('cookie-parser')(); | |
const cors = require('cors')({origin: true}); | |
const app = express(); | |
// See https://github.com/firebase/functions-samples/blob/Node-8/authorized-https-endpoint/functions/index.js | |
const validateFirebaseIdToken = require('./validateFirebaseIdToken'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// put this in AppServiceProvider::register to make the hash of the filename | |
// correspond to the SHA256 of the *CONTENTS* of the UploadedFile automatically | |
UploadedFile::macro('setHash', function () { | |
/** @var UploadedFile $this */ | |
$this->hashName = hash_file('sha256', | |
$this->getRealPath(), false); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR | |
ALTER PROCEDURE assets.sp_webinar_fix_utc_date @webinar_id BIGINT | |
AS | |
BEGIN | |
DECLARE @fixed_start_date DATETIMEOFFSET; | |
DECLARE @fixed_end_date DATETIMEOFFSET; | |
SET @fixed_start_date = (SELECT DATEADD(hh, 5, start_date) AT TIME ZONE 'Central Standard Time' | |
FROM assets.webinars | |
WHERE id = @webinar_id); | |
SET @fixed_end_date = (SELECT DATEADD(hh, 5, end_date) AT TIME ZONE 'Central Standard Time' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Enums; | |
use BenSampo\Enum\Enum; | |
final class HttpStatusCode extends Enum | |
{ | |
const Continue = 100; | |
const SwitchingProtocols = 101; |