Skip to content

Instantly share code, notes, and snippets.

Avatar
🍋
Hanging around.

Robert Lemon rlemon

🍋
Hanging around.
View GitHub Profile
View canada.sh
#!/bin/sh
while [ true ]; do
echo "Sorry!";
done
View hangman.js
"use strict";
const words = require("./words.json");
const faces = [":grin:", ":smile:", ":grinning:", ":slight_smile:", ":neutral_face:", ":slight_frown:", ":worried:", ":persevere:", ":tired_face:", ":dizzy_face:", ":skull:"];
module.exports = class Hangman
{
constructor()
{
this.guesses = new Set();
View KNAWLEDGE.cs
using System;
namespace System
{
internal static class KNAWLEDGE
{
internal static bool GARAGE(bool p, bool q)
{
return Books > Lambo;
}
View film.js
/* eslint-disable */
import filmData from './filmData';
const devTools = /./;
devTools.toString = function() {
this.opened = true;
};
const linesPerFrame = 14;
View file.js
// get your dependancies
// read up on ES modules or CJS modules.
// but this here is CJS modules
const express = require('express');
const http = require('http');
const path = require('path');
const app = express(); // create your express app
const server = http.createServer(app); // create your server, and pass it the app as its options, this will let express use that servers incoming and outgoing channels.
View .eslintrc
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "airbnb",
View apiRouter.js
import { Router } from 'express';
const router = Router();
router.get('/users', (err, req, res, next) => {
res.json(someshit);
});
router.get('/activities', (err, req, res, next) => {
res.json({message: 'look at all the room we have'});
View sample-bot-communication-so.js
const headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
};
fetch('/ws-auth', {
credentials: 'same-origin',
method: 'POST',
headers,
body: `fkey=${fkey().fkey}&roomid=17`
}).then(res => res.json()).then(connect);
@rlemon
rlemon / fetchWithProgress.js
Last active Apr 27, 2018
fetch with progress
View fetchWithProgress.js
async function fetchWithProgress(file, options = {}, progressUpdate = null) {
try {
const fileResponse = await fetch(file, options);
const totalBytes = fileResponse.headers.get('content-length');
// if there is no content length, we can't calculate any progress.
// also if there is no provided callback, there is no point.
if( totalBytes === null || progressUpdate === null ) {
if( totalBytes === null ) console.error('content-length not available');
return fileResponse;
You can’t perform that action at this time.