Skip to content

Instantly share code, notes, and snippets.

View cAstraea's full-sized avatar

cAstraea

View GitHub Profile
@cAstraea
cAstraea / ExamplePassportTest.php
Created January 22, 2022 20:26 — forked from archy-bold/ExamplePassportTest.php
Testing Passport Authenticated Controllers and Routes in Laravel
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExamplePassportTest extends \PassportTestCase
{
use DatabaseTransactions;
@cAstraea
cAstraea / gist:ca85b4e4c25fe2fe92523b0bdccda0e5
Created January 22, 2022 20:17 — forked from drakakisgeo/gist:48dcab1539612c82449b9757940ac7ee
Print Access Token from Laravel Passport
<?php
namespace App\Traits;
use App\User;
use DateTime;
use GuzzleHttp\Psr7\Response;
use Illuminate\Events\Dispatcher;
use Laravel\Passport\Bridge\AccessToken;
use Laravel\Passport\Bridge\AccessTokenRepository;
@cAstraea
cAstraea / myvueselect.js
Created July 28, 2020 12:28
myvueselect
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueSelect=e():t.VueSelect=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){r
@cAstraea
cAstraea / .block
Last active October 18, 2018 12:43
Mapbox routing demo (modified)
license: mit
@cAstraea
cAstraea / ffmpeg_install.md
Created April 18, 2018 14:04 — forked from jmsaavedra/ffmpeg_install.md
Install FFmpeg on a Linux Box

###Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

  • SSH into your instance and become root
@cAstraea
cAstraea / ensure-cert-macos.sh
Created April 16, 2018 07:29 — forked from koop/ensure-cert-macos.sh
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.
@cAstraea
cAstraea / ffmpeg
Last active February 8, 2018 15:28
ffmpeg stream commands
//transmux rtmp to hls stream with encoding
./ffmpeg -v verbose -i rtmp://52.197.22.*:1935/live1/nar-4 -c:v libx264 -c:a aac -ac 1 -strict -2 -tune zerolatency -crf 23 -preset veryfast -profile:v baseline -maxrate 1560k -bufsize 1560k -x264opts keyint=30:min-keyint=10:no-scenecut -b:v 500k -threads 0 -g 60 -movflags +faststart -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -start_number 1 /var/www/symfony/nar-4.m3u8
//transmux rtmp to hls stream without encoding
./ffmpeg -v verbose -i rtmp://52.197.22.*:1935/live1/nar-4 -c copy -flags -global_header -hls_time 10 -hls_list_size 6 -hls_wrap 10 -start_number 1 /var/www/symfony/nar-4.m3u8
thumbnail every 2 minutes
@cAstraea
cAstraea / index.html
Created November 24, 2017 11:51 — forked from PedroGutierrezStratio/index.html
Drawing the MongoDB's data with Chart.js through WebSockets.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<div style="margin: 20px;display: block;">
<canvas style="width: 600px; height: 300px" id="chart"></canvas>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js"></script>
<script>
var ws = new WebSocket('ws://127.0.0.1:8008/');
@cAstraea
cAstraea / index.html
Created November 24, 2017 11:51 — forked from PedroGutierrezStratio/index.html
Drawing the MongoDB's data with Chart.js through WebSockets.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<div style="margin: 20px;display: block;">
<canvas style="width: 600px; height: 300px" id="chart"></canvas>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js"></script>
<script>
var ws = new WebSocket('ws://127.0.0.1:8008/');
@cAstraea
cAstraea / ImageMagick 6.9.7-4 Homebrew Formula.md
Last active October 30, 2017 19:06 — forked from asanchez75/ImageMagick 6.9.7-4 Homebrew Formula.md
Homebrew Formula for ImageMagick 6.9.7-4

Homebrew Formula patching old ImageMagick release 6.9.7-4

Install

$ brew install https://gist.githubusercontent.com/asanchez75/7c3cd4358fb982c4028bfc021424dfbc/raw/62eb3ce49d82b8a5c6033ecb89bdefbec9d00e84/imagemagick.rb

Tested