Skip to content

Instantly share code, notes, and snippets.

View cstrat's full-sized avatar
🌶️
Spicy!

Chris Stratford cstrat

🌶️
Spicy!
View GitHub Profile
@cstrat
cstrat / gist:5429285
Created April 21, 2013 11:17
Squash Scorer Attempt ... Trying to get text aligned...
#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;
@cstrat
cstrat / gist:5433155
Last active December 16, 2015 12:18
103:23: error: initialization makes integer from pointer without a cast [-Werror]
#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 / background.js
Created September 6, 2018 05:52 — 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.
// 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 December 27, 2018 09:56
Meteor + React Router: Reactive Protected Routes
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 / pi.status.sh
Created May 16, 2020 21:37 — forked from dchakro/pi.status.sh
Bash shell script to print stats about a Raspberry running pihole
#!/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 / fwg_reboot_notifications.sh
Created August 24, 2021 00:03 — forked from mbierman/fwg_reboot_notifications.sh
Firewalla reboot notification via IFTT
#!/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
#!/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) {