Skip to content

Instantly share code, notes, and snippets.

View rebelchris's full-sized avatar
🏠
Working from home

Chris Bongers rebelchris

🏠
Working from home
View GitHub Profile
Up high in the cloud
That's where the servers live
Up high in the cloud
that's where the AI predicts
Up high in the cloud
Is where all our unfinished side projects live
Up high in the cloud
[
{
"value":"Pacific/Midway",
"label":"(UTC-11:00) Midway Island, American Samoa"
},
{
"value":"America/Adak",
"label":"(UTC-10:00) Aleutian Islands"
},
{
@rebelchris
rebelchris / search.js
Created June 15, 2021 06:22
Static website search
document.addEventListener('DOMContentLoaded', function(event) {
const search = document.getElementById('search');
const results = document.getElementById('results');
let data = [];
let search_term = '';
fetch('/search.json')
.then(response => response.json())
.then(data_server => {
data = data_server;
@rebelchris
rebelchris / main.py
Created May 26, 2021 06:25
Write data to Google Sheet in Python
from __future__ import print_function
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
# If modifying these scopes, delete the file token.json.
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
from __future__ import print_function
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
# If modifying these scopes, delete the file token.json.
SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly']
@rebelchris
rebelchris / styles.scss
Created January 23, 2021 15:06
Holder full
.holder - video-remote.full:before {
content: "Room is full!";
}
@rebelchris
rebelchris / script.js
Created January 23, 2021 15:05
Room full function
const roomFull = () => {
leave();
remote.classList.add("full");
};
@rebelchris
rebelchris / script.js
Created January 23, 2021 15:05
Room full check
rtc.client.on("user-published", async (user, mediaType) => {
if (rtc.client._users.length > 1) {
roomFull();
}
// Rest of the code
});
@rebelchris
rebelchris / script.js
Created January 23, 2021 15:04
Cam/mic buttons
btnCam.addEventListener("click", () => {
btnCam.classList.contains("active") ? stopVideo() : startVideo();
});
btnMic.addEventListener("click", () => {
btnMic.classList.contains("active") ? stopAudio() : startAudio();
});
@rebelchris
rebelchris / script.js
Created January 23, 2021 15:04
Stop video function
const stopVideo = () => {
rtc.localVideoTrack.close();
rtc.client.unpublish(rtc.localVideoTrack);
btnCam.classList.remove("active");
};