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
# Install dependencies "pip install youtube_transcript_api langchain" | |
# Run with "OPENAI_API_KEY=xxxx python summarize.py <youtube_id>" | |
import sys | |
from youtube_transcript_api import YouTubeTranscriptApi | |
from langchain import OpenAI, PromptTemplate | |
from langchain.text_splitter import TokenTextSplitter | |
from langchain.prompts import PromptTemplate |
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
(function() { | |
var origPeerConnection = window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection; | |
if (origPeerConnection) { | |
var newPeerConnection = function(config, constraints) { | |
console.log('PeerConnection created with config', config); | |
config.iceServers[1].urls = [ 'turns:turn.streamyard.com:443?transport=tcp']; | |
config.iceTransportPolicy = 'relay'; | |
// Add here the specific logic you need | |
// You can see some examples for specific use cases in the next sections of this document |
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
#!/usr/bin/env python | |
import psutil | |
import requests | |
meeting = 'zoom.us' in (p.name() for p in psutil.process_iter()): | |
requests.post('http://192.168.1.75:5000/ggb/' + 'on' if meeting else 'off') |
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
import os | |
from flask import Flask | |
from gpiozero import LED | |
app = Flask(__name__) | |
leds = { | |
'ggb': LED(17), | |
'ler': LED(27) | |
} |
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
use std::{ | |
fs, io, | |
net::SocketAddr, | |
path::{Path, PathBuf}, | |
sync::Arc | |
}; | |
use anyhow::{bail, Context, Result}; | |
use futures::{StreamExt, TryFutureExt}; | |
use structopt::{self, StructOpt}; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>octorus</title> | |
<meta name="description" content="octorus"> | |
<style> | |
canvas, video { | |
margin: 20px; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<style> | |
video { | |
margin: 2px; | |
border-radius: 200px; | |
object-fit: cover; | |
border-width: 0ps; |
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
import time | |
import redis | |
r = redis.StrictRedis() | |
script_set = r.register_script("local obj = cmsgpack.unpack(redis.call('hget', KEYS[1], ARGV[1]) or ''); if (not obj) then o = {} end; obj[ARGV[2]] = ARGV[3]; return redis.call('hset', KEYS[1], ARGV[1], cmsgpack.pack(obj))") | |
script_get = r.register_script("local obj = cmsgpack.unpack(redis.call('hget', KEYS[1], ARGV[1]) or ''); local res = {}; local n = 0; if (obj) then for k,v in pairs(oboj) do res[n + 1] = k; res[n + 2] = v; n = n + 2; end; end; return res") | |
print(script_set(keys=['user_id'], args=['device1', 'last_online', int(time.time())])) | |
print(script_get(keys=['user_id'], args=['device1'])) |
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
[2017-06-01 13:01:25.884145] [ Info ] [mediaserver]: type=video ssrc=4 18672/20901 [0] tl0picidx=22 | |
[2017-06-01 13:01:25.884163] [ Info ] [mediaserver]: type=video ssrc=4 18672/20902 [0] tl0picidx=22 | |
[2017-06-01 13:01:25.884244] [ Info ] [mediaserver]: type=video ssrc=4 18672/20903 [0] tl0picidx=22 | |
[2017-06-01 13:01:25.884306] [ Info ] [mediaserver]: type=video ssrc=4 18672/20904 [0] tl0picidx=22 | |
[2017-06-01 13:01:25.884492] [ Info ] [mediaserver]: type=video ssrc=4 18673/20905 [2] tl0picidx=22 | |
[2017-06-01 13:01:25.884555] [ Info ] [mediaserver]: type=video ssrc=4 18673/20906 [2] tl0picidx=22 | |
[2017-06-01 13:01:25.884622] [ Info ] [mediaserver]: type=video ssrc=4 18673/20907 [2] tl0picidx=22 | |
[2017-06-01 13:01:25.925743] [ Info ] [mediaserver]: type=video ssrc=4 18674/20908 [1] tl0picidx=22 | |
[2017-06-01 13:01:25.925911] [ Info ] [mediaserver]: type=video ssrc=4 18674/20909 [1] tl0picidx=22 | |
[2017-06-01 13:01:25.948806] [ Info ] [mediaserver]: type=video ssrc=4 18675/20910 [2] tl0pici |
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
#!/bin/bash | |
xcodebuild build -workspace ./project.xcworkspace -scheme 'MyLibrary' -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.3' |
NewerOlder