Skip to content

Instantly share code, notes, and snippets.

Avatar
🌶️
Spicy!

Chris Stratford cstrat

🌶️
Spicy!
View GitHub Profile
View firewalla-arp-dump.js
#!/usr/bin/env node
const spawn = require('child_process').spawn;
const https = require("https");
const arp = spawn("arp", ["-n"]);
const arpArray = [];
let buffer = '';
let errstream = '';
arp.stdout.on('data', function (data) {
@cstrat
cstrat / fwg_reboot_notifications.sh
Created Aug 24, 2021 — forked from mbierman/fwg_reboot_notifications.sh
Firewalla reboot notification via IFTT
View fwg_reboot_notifications.sh
#!/bin/bash
dir=$(dirname "$0")
IFTTTKEY="$(cat $dir/rebootdata.txt | grep IFTTTKEY | cut -f2 -d "=" )"
IFTTTrigger="$(cat $dir/rebootdata.txt | grep IFTTTTrigger | cut -f2 -d "=" )"
echo $IFTTTrigger
ONLINE=1
while [ $ONLINE -ne 0 ]
do
@cstrat
cstrat / pi.status.sh
Created May 16, 2020 — forked from dchakro/pi.status.sh
Bash shell script to print stats about a Raspberry running pihole
View pi.status.sh
#!/bin/bash
# Define colors
RED='\033[91m'
RED_solid='\033[101m'
GREEN='\033[92m'
GREEN_solid='\033[42m'
CYAN='\033[96m'
NC='\033[0m'
BLUE_solid='\e[44m'
@cstrat
cstrat / background.js
Created Sep 6, 2018 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
View background.js
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@cstrat
cstrat / routes.jsx
Last active Dec 27, 2018
Meteor + React Router: Reactive Protected Routes
View routes.jsx
import React from "react";
import { render } from "react-dom";
import { Meteor } from "meteor/meteor";
import { withTracker } from "meteor/react-meteor-data";
import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";
// Constant Components
import Header from "./ui/components/Header";
import Footer from "./ui/components/Footer";
@cstrat
cstrat / gist:5433155
Last active Dec 16, 2015
103:23: error: initialization makes integer from pointer without a cast [-Werror]
View gist:5433155
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0x7E, 0xAE, 0xA1, 0x05, 0x71, 0xC3, 0x4E, 0x4F, 0xAF, 0xF8, 0x19, 0x40, 0x88, 0xEA, 0x4A, 0xA4 }
PBL_APP_INFO(MY_UUID, "Squash Scorer V3", "Chris Stratford", 1, 1, DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP);
#define SCREEN_HEIGHT 152
#define SCREEN_WIDTH 144
@cstrat
cstrat / gist:5429285
Created Apr 21, 2013
Squash Scorer Attempt ... Trying to get text aligned...
View gist:5429285
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0x7E, 0xAE, 0xA1, 0x05, 0x71, 0xC3, 0x4E, 0x4F, 0xAF, 0xF8, 0x19, 0x40, 0x88, 0xEA, 0x4A, 0xA4 }
PBL_APP_INFO(MY_UUID, "Squash Scorer V3", "Chris Stratford", 1, 1, DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP);
Window window;