Skip to content

Instantly share code, notes, and snippets.

View BarryCarlyon's full-sized avatar
:octocat:
I'll sleep when I'm dead

Barry Carlyon BarryCarlyon

:octocat:
I'll sleep when I'm dead
View GitHub Profile
/*
https://dev.twitch.tv/docs/chat/chatbot-guide/
*/
import WebSocket from 'ws';
const OAUTH_TOKEN = 'CHANGE_ME_TO_YOUR_OAUTH_TOKEN'; // Needs scopes user:bot, user:read:chat, user:write:chat
const CHAT_CHANNEL_USER_ID = 'CHANGE_ME_TO_THE_CHAT_CHANNELS_USER_ID'; // This is the User ID of the channel that the bot will join and listen to chat messages of
<iframe src="https://www.twitch.tv/embed/MYCHANNEL/chat" id="chat_frame" style="width: 800px; height: 400px;"></iframe>
<script type="text/javascript">
var parent = ['sites.google.com', 'www.gstatic.com', window.location.host];
console.log(parent);
document.getElementById('chat_frame').setAttribute('src', document.getElementById('chat_frame').getAttribute('src') + '?parent=' + parent.join('&parent='));
</script>
@BarryCarlyon
BarryCarlyon / fetch_example.js
Last active November 1, 2022 14:45
Javascript Fetch Example. That does JSON and preserves statuscode
let url = new URL('some url');
let params = [
[ 'param_1', 'value' ],
[ 'param_2', 'value' ]
];
url.search = new URLSearchParams(params).toString();
fetch(
@BarryCarlyon
BarryCarlyon / server.js
Created November 23, 2021 15:35
Rig Run FrontEnd
const express = require('express');
const app = express();
app.listen(8080, function () {
console.log('booted express on', 8080);
});
app.use('/', Rigs);
@BarryCarlyon
BarryCarlyon / server.js
Last active November 23, 2021 15:36
Simplier Server for csharpfritz
const express = require('express');
const app = express();
let client_id = '';
// no https:// on this
let ebs_domain = 'the.klitok.apiserver';
/*
Setup Express to Listen on a Port
*/
@BarryCarlyon
BarryCarlyon / index.html
Last active April 3, 2021 12:19
TwitchDev onContext issue repro code
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://extension-files.twitch.tv/helper/v1/twitch-ext.min.js"></script>
<link rel="stylesheet" href="style.css" />
<title>Testing Extension</title>
</head>
<body>
<?php
/**
* JSON Web Token implementation, based on this spec:
* http://tools.ietf.org/html/draft-ietf-oauth-json-web-token-06
*
* PHP version 5
*
* @category Authentication
* @package Authentication_JWT
* @author Neuman Vong <[email protected]>
import React from 'react';
import { Page, Card } from '@shopify/polaris';
import { Form, FormLayout, TextField, Button } from '@shopify/polaris';
class App extends React.Component {
constructor(props) {
super(props);
}
Verifying that +barrycarlyon is my blockchain ID. https://onename.com/barrycarlyon
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#