No se necesita duplicar todo un script de PHP para solo comentar una funcion que no queremos que se llame.
This file contains 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 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 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 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 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 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; |
This file contains 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 | |
require __DIR__ . '/../wp-load.php'; | |
// si envías token, antes de esta línea tendrías que validar que el token es vigente, y de ahí obtener el token del usuario directo | |
if(!isset($_POST['email'])) { | |
$email = $_POST['email']; | |
} | |
$user = get_user_by('login', $email); | |
if (is_null($user)) { | |
invalidAuth(); |
This file contains 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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
const string2buffer = string => { | |
let tempArray = new Uint8Array(string.length) | |
for(let i = string.length; i--) tempArray[i] = string.charCodeAt(i) | |
return tempArray.buffer | |
} |