Skip to content

Instantly share code, notes, and snippets.

View tzkmx's full-sized avatar
🎉
estrenando repositorios privados

Jesus Franco tzkmx

🎉
estrenando repositorios privados
View GitHub Profile
@tzkmx
tzkmx / app-navigation-tree.json
Last active June 23, 2023 02:25
App Navigation Tree JSON Schema
{
"$id": "https://gist.githubusercontent.com/tzkmx/0b31897ea96fb3e36f8debdc050121b9/raw/bdda2e9b636d1130e4000d6c829113d62c4bcd4c/app-navigation-tree.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "App Contents Navigation Manifest",
"description": "A blueprint for application navigation",
"properties": {
"home": {
"description": "First screen interactive for users (after authentication flow if required)",
"type": "object",
"properties": {
@zanona
zanona / sentry-serverless-firebase.ts
Last active April 3, 2024 15:48
Missing Sentry's firebase serverless wrappers
/**
* 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';
<?php
namespace App\Enums;
use BenSampo\Enum\Enum;
final class HttpStatusCode extends Enum
{
const Continue = 100;
const SwitchingProtocols = 101;
Hay que modificar el archivo applicationHost.config para poder aceptar el método PUT.
Referencia: https://www.azuretechguy.com/applicationhost-config-file-in-azure-app-service
* Agregar extensión IIS Manager a Azure webapp
* En applicationHost.xdt agregar lo siguiente:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<security>
@dusterio
dusterio / .js
Created October 20, 2019 08:16
Decrypting Laravel's session cookie with JavaScript and Cloudflare
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
}
@aungwinthant
aungwinthant / FCM.php
Last active July 20, 2023 11:53
Firebase Cloud Messaging with Guzzle HTTP Client (Only For Topics)
<?php
use GuzzleHttp\Client;
class FCM{
protected $endpoint;
protected $topic;
protected $data;
protected $notification;
@x1wins
x1wins / encoding_h264.sh
Last active April 16, 2019 22:10
FFMpeg convert ts to hls
#!/usr/bin/env bash
set -e
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
source="${1}"
target="${2}"
command="ffmpeg -hide_banner -y -i ${1} \
-vf scale=w=640:h=360 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename ${target}/360p_%03d.ts ${target}/360p.m3u8 \
-vf scale=w=842:h=480 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename ${target}/480p_%03d.ts ${target}/480p.m3u8 \
-vf scale=w=1280:h=720 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename ${target}/720p_%03d.ts ${tar
@vanushwashere
vanushwashere / README.md
Last active April 18, 2024 03:14
Systemd unit file for supervisord service

Systemd unit file for supervisord service

  • place this config in /etc/systemd/system/supervisord.service
  • kill all supervisord processes
  • sudo systemctl daemon-reload
  • sudo systemctl enable supervisord
  • start with sudo systemctl start supervisord if already not started
@katowulf
katowulf / create_user_functions.js
Created December 3, 2018 22:23
Create a Firebase user from an authenticated Cloud Functions HTTPS endpoint.
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');
@mrpinghe
mrpinghe / auth.js
Last active August 23, 2023 21:17
Veracode custom HMAC request signing algorithm (used for API authorization)
var crypto = require('crypto');
const id = process.env.API_ID; // your API ID, reading from environment variable
const key = process.env.KEY; // your API key, reading from environment variable
const preFix = "VERACODE-HMAC-SHA-256";
const verStr = "vcode_request_version_1";
var resthost = "api.veracode.com"; // rest host
var xmlhost = "analysiscenter.veracode.com"; // xml host