Skip to content

Instantly share code, notes, and snippets.

View jasonhejna's full-sized avatar

Jason Hejna jasonhejna

View GitHub Profile
@jasonhejna
jasonhejna / autohotspot
Created September 3, 2018 15:29
Raspberry Pi IOT WiFi
#!/bin/bash
#version 0.95-4-N/HS
#You may share this script on the condition a reference to RaspberryConnect.com
#must be included in copies or derivatives of this script.
#A script to switch between a wifi network and a non internet routed Hotspot
#Works at startup or with a seperate timer or manually without a reboot
#Other setup required find out more at
#http://www.raspberryconnect.com
@jasonhejna
jasonhejna / Readme.md
Created June 28, 2018 20:53
MongoDB update data for schema changes

/** *

  • Run this script with the command: node schema-migration.js ./example-schema-update-rules.json
  • Replace example-schema-update-rules.json with your own version of the file.
  • There are three JSON operations for modifying data...
  • @addFields will add new fields to the data with a value you can optionally specify
  • @updateFields will map a field over to to a new key. Persisting the data value.
  • @deleteFields will delete the fields you specify
@jasonhejna
jasonhejna / christmas_card_2016_c.md
Last active November 28, 2016 19:25
holiday card 2016
    .--._.--.--.__.--.--.__.--.--.__.--.--.__.--.--._.--.
  _(_      _Y_      _Y_      _Y_      _Y_      _Y_      _)_
 [___]    [___]    [___]    [___]    [___]    [___]    [___]
 /:' \    /:' \    /:' \    /:' \    /:' \    /:' \    /:' \
|::   |  |::   |  |::   |  |::   |  |::   |  |::   |  |::   |
\::.  /  \::.  /  \::.  /  \::.  /  \::.  /  \::.  /  \::.  /
 \::./    \::./    \::./    \::./    \::./    \::./    \::./
 '=' '=' '=' '=' '=' '=' '='
#include <stdio.h>
int main()
{
for ( int i=0; i < 3; i++ ){
printf("%s\n", "Ho");
}
printf("%s\n", "Happy Holidays");
return 0;
}
@jasonhejna
jasonhejna / double_tap_light.ino
Last active December 30, 2015 04:51
When you flick the lights on and off it will trigger. Arduino with a photo-resistor.
// DOUBLE TAP LIGHT 0.1
unsigned long off_timer = 18000;
int power = 3;
int sensor = 5;
int threshold = 190;
unsigned long loop_count = 0;
int sense_val = 0;
"""Ingests a customer list from MS and helps detect / convert the fields for quicker ET ingestion"""
# TODO: add delete
import shutil
import os
import ntpath
FILE_PATH = raw_input('Enter the file path: ')
@jasonhejna
jasonhejna / ATtiny85_cellular_MG2639.ino
Last active February 13, 2016 06:53
ATtiny85 code for serial communication with the MG2639 cellular modem
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
// Timing Characteristics All constants in this section defined in milliseconds
#define POWER_PULSE_DURATION 2000 // 2-5s pulse required to turn on/off
#define MODULE_OFF_TIME 10000 // Time the module takes to turn off
#define COMMAND_RESPONSE_TIME 500 // Command response timeout on UART
#define MODULE_WARM_UP_TIME 3000 // Time between on and ready
@jasonhejna
jasonhejna / halloween_skeleton.ino
Last active October 23, 2015 13:41
Arduino Controlled Animatronic Skeleton
#include <Stepper.h>
#include <Servo.h>
// create servo object
Servo myservo;
// instantiate a variable to store the servo position
int pos = 0;
@jasonhejna
jasonhejna / 4k_website_tester.html
Last active April 21, 2023 22:36
Test a website in 4k resolution without a 4k monitor
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>4k website tester</title>
<style>
iframe:focus {
outline: none;
}
iframe{
var main = {
letterArr: null,
parse: function (_input) {
this.letterArr = _input.toUpperCase().split('');
},
runMyCode: function () {
var asciiLetter = null;
var inputLetter = null;
var j = 0;