Skip to content

Instantly share code, notes, and snippets.

View EvanGertis's full-sized avatar
crush it.

Evan Gertis EvanGertis

crush it.
View GitHub Profile
@EvanGertis
EvanGertis / EmonCMS.ino
Created June 14, 2018 00:30
Arduino Code for Emoncms
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
IPAddress ip(192,168,0, 13);
IPAddress gateway(192,168,0, 1);
IPAddress subnet(255, 255, 255, 0);
EthernetClient webClient;
@EvanGertis
EvanGertis / EmonCMS.ino
Last active June 18, 2018 00:15
Solution for EMONCMS
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
IPAddress ip(192,168,0, 13);
EthernetClient client;
unsigned long lastConnectionTime = 0;
const unsigned long postingInterval = 60000;
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Subject } from 'rxjs/Subject';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { User } from './user.model';
import {CognitoUser, CognitoUserAttribute, CognitoUserPool} from 'amazon-cognito-identity-js';
@EvanGertis
EvanGertis / square.js
Created February 1, 2019 14:32
javascript square function
function square(UI_body, width, height, color){
let square = document.createElement('div');
square.style.width = width;
square.style.height = height;
square.style.margin = "2px 2px 2px 2px";
square.style.backgroundColor = color;
UI_body.append(square);
}
// generates a parent container to store grid squares.
function UI_box(UI_box_number){
UI_body = document.createElement("div");
body[0].append(UI_body);
UI_body.setAttribute("id", UI_box_number);
UI_body.style.display = "flex";
return UI_body;
}
let body = document.getElementsByTagName("body");
// global variables to set color
let color = "";
let color_one = "red";
let color_two = "black";
// square size parameters.
let square_width = "100px";
let square_height = "100px";
struct node
{
int data;
struct node *link;
};
// inserts a node after the header node.
void insertAtEnd(struct node *head, int data)
{
void createList(struct node *head)
{
int n, data;
// prompts.
printf("Enter the number of nodes that you would like insert ");
scanf("%d", &n);
// guard.
if(n == 0){
// loops through the list and shows the value at each node.
void displayList(struct node *head)
{
struct node *p;
p = head->link;
while (p != NULL)
{
printf("%d ", p->info);
int main()
{
int choice, data, x, k;
struct node *head;
head = (struct node *)malloc(sizeof(struct node));
head->info = 0;
head->link = NULL;
createList(head);