This file contains hidden or 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
name: Publish NPM Package | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
CODEARTIFACT_DOMAIN: <your-codeartifact-domain> |
This file contains hidden or 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
const colorPalettes = [['#152A3B', '#0D809C', '#F5C03E', '#D63826', '#EBEBD6'], | |
['#0F4155', '#5399A1', '#8CA96B', '#CB5548', '#E7E6F5'], | |
['#E8614F', '#F3F2DB', '#79C3A7', '#668065', '#4B3331'], | |
['#DBE5EC', '#336B87', '#2A3132', '#E94D35', '#EFAC55']]; | |
let num = 10; | |
let colorThemeIndex = 2; | |
let queueNumber = [0, 1, 2, 3, 4]; | |
let currentPalette, tileLen; | |
function draw() { |
This file contains hidden or 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
let size = 500; | |
function setup() { | |
if (windowWidth < size) { | |
size = windowWidth; // p5.js property containing window width | |
} | |
createCanvas(size, size); // Creates a new canvas of given size | |
background(25); // adds color to canvas background | |
angleMode(DEGREES); // sets p5.js anglemode to degrees | |
noLoop(); // stop the draw function from executing continuously |
This file contains hidden or 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"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains hidden or 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
// events.js | |
const EventEmitter = require('eventemitter3'); | |
const emitter = new EventEmitter(); | |
function subscribe(req, res) { | |
res.writeHead(200, { | |
'Content-Type': 'text/event-stream', | |
'Cache-Control': 'no-cache', | |
Connection: 'keep-alive' |
This file contains hidden or 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
const evtSource = new EventSource('/events'); | |
evtSource.addEventListener('event', function(evt) { | |
const data = JSON.parse(evt.data); | |
// Use data here | |
},false); |
This file contains hidden or 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
const express = require('express'); | |
const events = require('./events'); | |
const path = require('path'); | |
const app = express(); | |
const port = process.env.PORT || 5001; | |
const expressWs = require('express-ws')(app); |
This file contains hidden or 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 () { | |
// if user is running mozilla then use it's built-in WebSocket | |
window.WebSocket = window.WebSocket || window.MozWebSocket; | |
const connection = new WebSocket('ws://localhost:8080/githubEvents'); | |
connection.onopen = function () { | |
// connection is opened and ready to use | |
}; |
This file contains hidden or 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
/* Client - subscribing to the github events */ | |
subscribe: (callback) => { | |
const pollUserEvents = () => { | |
$.ajax({ | |
method: 'GET', | |
url: 'http://localhost:8080/githubEvents', | |
success: (data) => { | |
callback(data) // process the data | |
}, | |
complete: () => { |
This file contains hidden or 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
http { | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; | |
proxy_temp_path /var/tmp; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
gzip_comp_level 6; |
NewerOlder