Skip to content

Instantly share code, notes, and snippets.

View ggarber's full-sized avatar

Gustavo Garcia ggarber

View GitHub Profile
# 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
(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
#!/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')
import os
from flask import Flask
from gpiozero import LED
app = Flask(__name__)
leds = {
'ggb': LED(17),
'ler': LED(27)
}
use std::{
fs, io,
net::SocketAddr,
path::{Path, PathBuf},
sync::Arc
};
use anyhow::{bail, Context, Result};
use futures::{StreamExt, TryFutureExt};
use structopt::{self, StructOpt};
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>octorus</title>
<meta name="description" content="octorus">
<style>
canvas, video {
margin: 20px;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
video {
margin: 2px;
border-radius: 200px;
object-fit: cover;
border-width: 0ps;
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']))
[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
#!/bin/bash
xcodebuild build -workspace ./project.xcworkspace -scheme 'MyLibrary' -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.3'