This file contains 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 addOverlay() { | |
destroyOverlay() | |
overlay = document.createElement('div'); | |
overlay.classList.add('annotation-overlay'); | |
overlay.setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;'); | |
document.body.appendChild(overlay); | |
} | |
function destroyOverlay() { |
This file contains 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
// ==UserScript== | |
// @name Mozilla Thimble Projects Sorter | |
// @namespace https://gist.github.com/bfritscher/0521b90c347c89cf40ff5e4258975ae0 | |
// @version 2 | |
// @match https://thimble.mozilla.org/* | |
// @grant none | |
// ==/UserScript== | |
document.querySelectorAll('.glitch-banner').forEach( it => it.remove()); | |
document.querySelectorAll('.glitch > .btn.export-button').forEach( it => it.remove()); |
This file contains 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
var http = require('http'); | |
var request = require('request'); | |
function onRequest(req, res){ | |
// Set CORS headers | |
res.setHeader('Access-Control-Allow-Origin', '*'); | |
res.setHeader('Access-Control-Request-Method', '*'); | |
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET'); | |
res.setHeader('Access-Control-Allow-Headers', '*'); | |
if ( req.method === 'OPTIONS' ) { |
This file contains 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
var fontSize = 20; | |
var style = document.createElement('style'); | |
style.innerText = '#output li, #exec, .fakeInput, .fakeInput:before, #exec:before, #bin .editbox .CodeMirror, .mobile .editbox textarea{ font-size: ' + fontSize + 'px !important; }'; | |
document.head.append(style); |
This file contains 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
import esp | |
from flashbdev import bdev | |
import machine | |
# https://github.com/micropython/micropython/issues/2352 | |
ADC_MODE_VCC = 255 | |
ADC_MODE_ADC = 0 | |
def set_adc_mode(mode): | |
sector_size = bdev.SEC_SIZE |
This file contains 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
/* FOR COMMENTS PLEASE USE https://github.com/bfritscher/esp8266_PZEM-004T */ | |
/* NOTIFICATION ARE NOT SENT BY EMAIL FOR GISTS :-( */ | |
// VERSION 2 with WiFIManager integration for device_name | |
#include <FS.h> //this needs to be first, or it all crashes and burns... | |
#include <ESP8266WiFi.h> // ESP8266 Core WiFi Library (you most likely already have this in your sketch) | |
#include <Ticker.h> // for LED status | |
#include <DNSServer.h> // Local DNS Server used for redirecting all requests to the configuration portal |
This file contains 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
#!/usr/bin/python3 | |
from nanpy.arduinotree import ArduinoTree | |
from nanpy.serialmanager import SerialManager | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import http.client, urllib.parse | |
import time | |
import datetime | |
import numpy | |
import logging | |
import threading |
This file contains 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
#!/usr/bin/python3 | |
from nanpy.arduinotree import ArduinoTree | |
from nanpy.serialmanager import SerialManager | |
import http.client, urllib.parse | |
import time | |
import datetime | |
import numpy | |
API_KEY = '' | |
SLEEP = 300 |
This file contains 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
# apt-get install fcgiwrap | |
location /cgi-bin/ { | |
gzip off; | |
root /var/www; | |
fastcgi_pass unix:/var/run/fcgiwrap.socket; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} |
This file contains 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
<script id="jsbin-javascript"> | |
var aGlobalVar = 'hello'; | |
var anotherGlobalVar = 'world'; | |
function myFunction() { | |
aGlobalVar = 'yo'; | |
var anotherGlobalVar = 'yeep'; | |
var localVar = 'local'; | |
iAmNotALocalVariable = 'iAmGlobal'; | |
} |