Skip to content

Instantly share code, notes, and snippets.

View ccutch's full-sized avatar
🎯
Focusing

Connor McCutcheon ccutch

🎯
Focusing
  • California
View GitHub Profile
@ccutch
ccutch / Actors.ipynb
Created March 22, 2021 10:16
Just incase you forgot i was insane
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ccutch
ccutch / Firebase.js
Last active November 29, 2018 06:11 — forked from codyswain/Firebase.js
The only important line of HomeScreen.js is line 34. The variable assignment here returns a Promise but no data.
import * as firebase from 'firebase'
import 'firebase/firestore';
class FireBase {
constructor() {
let config = {
apiKey: "AIzaSyAO8BB0W6mXDr3ihvkMn-uJjopgfsf_qow",
authDomain: "cherishly-412dd.firebaseapp.com",
databaseURL: "https://cherishly-412dd.firebaseio.com",
projectId: "cherishly-412dd",
@ccutch
ccutch / match_prop.rs
Created November 11, 2018 01:58
Making a quick macro to easily write functions for enums that simply match an variant to a defined return type
// Example enum Material
pub enum Material {
Grass,
Sand,
Rock,
Water,
}
// match_prop macro
macro_rules! match_prop {
@ccutch
ccutch / main.rs
Created July 20, 2018 21:48
Mqtt subscriber and publisher in rust
extern crate mqttc;
extern crate netopt;
extern crate ws;
use mqttc::{PubOpt, PubSub};
use std::{thread, time};
static USERNAME: &'static str = "";
static PASSWORD: &'static str = "";
@ccutch
ccutch / bindto.js
Last active February 26, 2018 22:54
React component binding to custom html elements. Use `npm install && npm run start` to run
import React from 'react'
import ReactDOM from 'react-dom'
export default (Component, tagname) => {
class Binder extends HTMLElement {
connectedCallback() {
const mountPoint = document.createElement('div');
this.attachShadow({ mode: 'open' }).appendChild(mountPoint);
go template example
package main
import (
"fmt"
"time"
"github.com/AsynkronIT/protoactor-go/actor"
)
func main() {
package main
import "fmt"
import "bytes"
import "encoding/gob"
import "encoding/hex"
import "github.com/AsynkronIT/protoactor-go/actor"
type MyActor struct {
CallCount int
package main
import "fmt"
import "log"
import "encoding/gob"
import "bytes"
type Talkable interface {
Talk()
}
@ccutch
ccutch / elements.spec.js
Created November 7, 2017 08:02
How I would write specification files
import { spec, types, define, abstract, Api } from "spectacles";
spec(module, "elements").ensure("./models/element");
abstract`
This is a module used for elements
`;
// Definitions
define.submodule("constants", "./constants")`