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
// something comparable to PHP range method. Supports numbers and letters. | |
function range(start, end, step) { | |
start || alert('must have 1+ params'); | |
if (!end) {end = start; start = 0;} | |
var step = step || 1; | |
var range = []; | |
var is_num = !isNaN(start); | |
start = !is_num ? start.charCodeAt(0) : start; | |
end = !is_num ? end.charCodeAt(0) : end; | |
step = !is_num ? Math.max(Math.round(step), 1) : step; |
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
<?php | |
# base code found here: http://stackoverflow.com/questions/3085990/post-a-file-string-using-curl-in-php | |
$delimiter = '----WebKitFormBoundary'.uniqid(); | |
$data = create_post($delimiter, array( | |
'bingo' => 'yes' | |
), array( | |
'file' => array( | |
'filename' => 'data.txt', |
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
--- | |
ECOM00001: | |
description: "The AWS Access Key Id you provided does not exist." | |
level: alert | |
ECOM00002: | |
description: "Overtime Limit Exceeded" | |
level: retry | |
ECOM00003: | |
description: "The specified bucket does not exist." | |
level: alert |
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
#!python | |
# coding: utf-8 | |
# This is a simple script to quickly switch between HMD mode and headless mode with Vive in SteamVR | |
# It uses symlinks to ensure that SteamVR will continue to run and always preserves the original files, | |
# This should be able to be rerun following updates (assuming the configs haven't structurally changes | |
# along with anything else) -- symlinks require running with elevated priviledges | |
import sys, os, ctypes, time, json, shutil | |
from winreg import QueryValueEx, HKEY_CURRENT_USER, OpenKey |
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
<!-- this was just a rapid development program for fun --> | |
<html> | |
<body> | |
<h1>Chutes and Ladders!</h1> | |
<button onclick="beginGame()">Play Game</button> | |
<img src="https://thumbs.dreamstime.com/z/s-board-games-chutes-ladders-woodbridge-new-jersey-october-circa-game-shown-128701391.jpg" /> | |
<script> | |
// general configs | |
var spin_min = 1, spin_max = 6; | |
var exact_space_win = true; |
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
void displayPositionedText(char* buf, int textSize, Position vpos, Position hpos) { | |
display.setTextSize(textSize); | |
int16_t x1, y1; | |
uint16_t w, h; | |
display.getTextBounds(buf, 0, 0, &x1, &y1, &w, &h); | |
int _vpos = 0, _hpos = 0; | |
switch (vpos) { | |
case CENTER: |
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
from picamera import PiCamera | |
from picamera.array import PiRGBArray | |
import sys, curses, time, cv2 | |
import numpy as np | |
import warnings | |
import collections | |
# TODO: resolve these at some point | |
warnings.filterwarnings(action='ignore', message='Mean of empty slice') | |
warnings.filterwarnings(action='ignore', message='invalid value encountered in double_scalars') |
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
#include <Arduino.h> | |
#include "Animator.h" | |
Animator::Animator(){ | |
// nothing for now | |
} | |
void Animator::begin(Adafruit_SSD1306 *display, unsigned int width, unsigned int height, HardwareSerial* serial){ | |
_display = display; | |
_stream = serial; |
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
{ | |
"build": { | |
"arduino": { | |
"ldscript": "esp32c3_out.ld" | |
}, | |
"core": "esp32", | |
"extra_flags": [ | |
"-DARDUINO_LOLIN_C3_PICO", | |
"-DARDUINO_USB_MODE=1", | |
"-DARDUINO_USB_CDC_ON_BOOT=1" |
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
#include <Arduino.h> | |
#include <ModbusMaster.h> | |
#define MAX485_DE_RE 4 | |
#define OUTPUT_MOTOR_FREQ 0x0007 | |
#define DRIVE_STATUS 0x0006 | |
#define DRIVE_TEMP 0x0018 | |
ModbusMaster node; |
OlderNewer