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
<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 <neuman@twilio.com>
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' '*';
#
@BarryCarlyon
BarryCarlyon / restart.sh
Created February 7, 2014 17:57
Minecraft Restarter
#!/bin/bash
#restart
screen -x minecraft -X stuff "`printf "say ALERT: Scheduled Restart in 60 seconds\r"`"
sleep 30
screen -x minecraft -X stuff "`printf "say ALERT: Scheduled Restart in 30 seconds\r"`"
sleep 20
screen -x minecraft -X stuff "`printf "say ALERT: Scheduled Restart in 10 seconds\r"`"
sleep 1
screen -x minecraft -X stuff "`printf "say ALERT: Scheduled Restart in 9 seconds\r"`"