Skip to content

Instantly share code, notes, and snippets.

View HipsterBrown's full-sized avatar

Nick Hehr HipsterBrown

View GitHub Profile
@mcvella
mcvella / viam_python_venv.md
Last active September 28, 2023 18:14
Viam Python venv

Viam + Python

This guide will help you get set up with Viam with Python. It assumes that you are starting from scratch, and will walk you through setting up a fresh environment and installing the necessary requirements.

Setup your project

The first step is to create a directory to house your project. For this guide, we will be using the directory name viam-python:

mkdir viam-python
@souporserious
souporserious / build.mjs
Created February 24, 2022 02:48
Build script using esbuild and ts-morph to bundle library code.
import glob from 'fast-glob'
import { build } from 'esbuild'
import { Project } from 'ts-morph'
const project = new Project({
compilerOptions: {
outDir: 'dist',
emitDeclarationOnly: true,
},
tsConfigFilePath: './tsconfig.json',
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 17, 2024 13:15
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
var five = require("johnny-five");
var keypress = require("keypress");
var options = {
// TODO: YOU SHOULD PUT THIS IN HERE
// TODO: we can make cute names for this?
'port' : '/dev/tty.GoldsamBot-SPPDev'
}
var board = new five.Board(options);
@dmiller9911
dmiller9911 / reactSlotExample.jsx
Created January 30, 2017 02:42
React Slot Example
import React from 'react';
import ReactDOM from 'react-dom';
function Slot({ children, slot }) {
let slottedChild = null; // Default to null since react can render null if a slot isn't found
// Iterate over children to find the slot needed
React.children.forEach(children, (child) => {
if (!React.isValidElement(child)) { // Check that it is a valid react element.
return; // Return since we can't do anything with a child without props.
}
@jennschiffer
jennschiffer / whatever.md
Created October 5, 2014 18:22
JavaScript book recommendations for Jenn

looking for book recommendations. please comment with books and what level (beginner, advanced, etc) thnx babes

@ajfisher
ajfisher / firmatatest.js
Last active December 22, 2019 08:15
Serial comms over hardware UART for Johnny-Five between Arduino and a Raspberry Pi
var firmata = require('firmata');
var repl = require('repl');
var board = new firmata.Board('/dev/ttyAMA0',function(err){
//arduino is ready to communicate
if (err) {
console.log("err:" + err);
return;
}
console.log("Firmata Firing LEDs");
@joakimbeng
joakimbeng / router.html
Last active March 15, 2024 06:18
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:
@molovo
molovo / gist:6907965
Last active September 16, 2019 03:47
A short snippet for exporting posts from Anchor CMS into separate .markdown files for use with Jekyll. Just add the created files straight into your _posts folder in jekyll. The following code goes into /anchor/routes/site.php, then just visit <site URL>/export to create the files
Route::get('export', function() {
$posts = Post::where('status', '=', 'published')->get();
foreach ($posts as $post) {
$content = <<<EOD
---
layout: post
title: "$post->title"
date: $post->created
categories: blog