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
import { Room, RoomEvent, createAuth } from '@inlivedev/inlive-js-sdk'; | |
const auth = await createAuth({ | |
apiKey: 'YOUR_API_KEY', | |
expirySeconds: 3600, | |
}); | |
const room = Room(); | |
room.setAuth(auth); |
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
ffmpeg -f flv -listen 1 -i rtmp://127.0.0.1:19350/live/app \ | |
-c:v libx264 -b:v:0 5000k -b:v:1 2000k -crf 23 -g 120 -format_options "movflags=cmaf" -adaptation_sets "id=0,streams=v id=1,streams=a" \ | |
-frag_type duration -keyint_min 120 -maxrate 1M -bufsize 2M -force_key_frames "expr:gte(t,n_forced*4)" \ | |
-pix_fmt yuv420p -profile:v baseline -an -s 1280x720 \ | |
-ldash 1 -streaming 1 -use_template 1 -use_timeline 0 -seg_duration 4 -frag_duration 1 -frag_type duration \ | |
-utc_timing_url "http://time.akamai.com/?iso%26ms" -window_size 15 -extra_window_size 15 -remove_at_exit 1 -f dash ./ldash/1.mpd |
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
export default class FirestoreModule{ | |
constructor(apiKey,authDomain,databaseURL,projectId){ | |
this.promise=false; | |
this.db=null; | |
this.apiKey=apiKey; | |
this.authDomain=authDomain; | |
this.databaseURL=databaseURL; | |
this.projectId=projectId; | |
} | |
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 | |
function lazyloadImages($html) { | |
$matches = array(); | |
preg_match_all( '/<img[\s\r\n]+.*?>/is', $html, $matches ); | |
$search = array(); | |
$replace = array(); | |
foreach ( $matches[0] as $imgHTML ) { |
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 config = { | |
// If the image gets within 50px in the Y axis, start the download. | |
rootMargin: '50px 0px', | |
threshold: 0.01 | |
}; | |
const observer = new IntersectionObserver(onIntersection, config); | |
function loadImage(el){ | |
el.className = el.className.replace( /(?:^|\s)lazy-hidden(?!\S)/g , '' ); |
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
function add_defer_attribute($tag, $handle) { | |
// add script handles to the array below | |
$scripts_to_defer = array( | |
'html5', | |
'jquery', | |
'jquery-migrate', | |
'wp-embed', | |
'twentyseventeen-skip-link-focus-fix', | |
'jquery-scrollto', | |
'twentyseventeen-global', |
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
#!/usr/bin/env node | |
var path=require('path'); | |
var fs = require('fs'); | |
if(process.argv.length<3) | |
throw new Error('You\'re not passing the geojson file'); | |
var file=process.argv[2]; | |
var gjFile=fs.statSync(file); | |
if(!gjFile.isFile()) | |
throw new Error('File not found'); |