Skip to content

Instantly share code, notes, and snippets.

View CalebEverett's full-sized avatar

Caleb CalebEverett

View GitHub Profile
@CalebEverett
CalebEverett / events-websock.js
Last active March 29, 2023 15:04
Lxd api example: lxc exec and operations websocket via nodejs
const fs = require('fs')
const WebSocket = require('ws');
const wsoptions = {
cert: fs.readFileSync('../../.config/lxc/client.crt'),
key: fs.readFileSync('../../.config/lxc/client.key'),
rejectUnauthorized: false
}
var ws = new WebSocket('wss://127.0.0.1:8443/1.0/events?type=operation', wsoptions);
gid:WHWjBqnGjgyYpCwEK7AkQk
@CalebEverett
CalebEverett / deser_example.rs
Created September 25, 2021 16:37
Rust deserialize json string in json field
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let fields: Vec<&str> = vec![
"id",
"artistName",
"curationStatus",
"dynamic",
"name",
@CalebEverett
CalebEverett / build.yaml
Last active March 3, 2021 20:03
Github actions build for cscs_utils
name: build status
env:
CANVAS_TOKEN: ${{ secrets.CANVAS_TOKEN }}
CANVAS_URL: https://canvas.harvard.edu
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CSCI_SALT: ${{ secrets.CSCI_SALT }}
on:
push:
name: CI/CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CANVAS_ASSIGNMENT_ID: 442683 # Test Assignment
@CalebEverett
CalebEverett / caleb.gin
Created December 30, 2020 04:38
config.gin for learning trax
import trax.layers
import trax.models
import trax.optimizers
import trax.data.inputs
import trax.supervised.trainer_lib
# Parameters that will vary between experiments:
# ==============================================================================
max_len = 128
@CalebEverett
CalebEverett / appinst.sh
Last active October 18, 2018 01:47
Bash Script to Launch LXC Container
#!/bin/bash
# variables
CONTAINER=mycontainer
IMAGE=ubuntu-daily:xenial
PORT=8080
PROFILES=default
FOLDER=app
REPO=https://github.com/CalebEverett/hello-lxd.git
RUN_USER=app
@CalebEverett
CalebEverett / gist:712fb3948d2695a95957
Last active January 26, 2017 21:01
Help with material-ui leftNav,react-router and redux

I am having trouble getting this to work. I'm trying to get the material ui leftNav to work with react router and redux with nav going through the store and router. This was close, but didn't get all the way to the menu item.

TypeError: Cannot read property 'isActive' of undefined

I was also referring to these examples: https://github.com/callemall/material-ui/blob/master/docs/src/app/components/app-left-nav.jsx

http://codetheory.in/react-integrating-routing-to-material-uis-left-nav-or-other-components/

@CalebEverett
CalebEverett / gist:ad8dda9e93ccad1c37ae
Last active November 7, 2015 02:13
Error on build
```
caleb.everett@Caleb-Laptop-New MINGW64 /d/projects/rrum (toolbox)
$ npm run dev
> react-redux-universal-hot-example@0.0.5 dev D:\projects\rrum
> concurrent --kill-others "npm run watch-client" "npm run start-dev" "npm run start-dev-api"
[0]
[0] > react-redux-universal-hot-example@0.0.5 watch-client D:\projects\rrum
[0] > node ./node_modules/better-npm-run watch-client