Skip to content

Instantly share code, notes, and snippets.

View loganpowell's full-sized avatar

Logan Powell loganpowell

  • Metro DC
View GitHub Profile
@loganpowell
loganpowell / flicker-fix.md
Created December 8, 2023 21:01
Fix VSCode Screen Flicker (Mac Apple Silicon)
  1. Open VSCode, cmd + shift + p
  2. Search for Preferences : Configure Runtime Arguments
  3. This will open the argv.json file with startup setting for VSCode.
// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelihood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
@loganpowell
loganpowell / readme.md
Created January 31, 2019 22:35 — forked from jonlidgard/readme.md
PRU's on the Beaglebone Black

PRU’s on the Beaglebone - ( Using UIO with the TI Kernel )

This guide is written for fellow newbies to the BBB as an aid to understanding how to talk to the onboard PRU's. As a newbie some of my terminology and understanding may not be quite correct, however it's hopefully enough to give you an idea what is going on. The whole subject is a bit of a minefield for the beginner; a lot of things have changed over the last few years and most of the guides you come across are only partially correct, you have to pick through the bones to find the nuggets!. If you're using a modern stock debian image then blindly following them will lead to nothing but frustration. This guide will surely become irrelevant with time too but hopefully as of Oct 2017 it will be of some use.

My system

I'm using the stock debian 9.1 IOT image from Beagleboard.org on an old 2GB Beaglebone Black.

rproc & uio, Kernel images, dtb's, uboot overlays, omg wtf?

In the beginning there was the Linux Userspace I/O interface (UIO) for commu

@loganpowell
loganpowell / chunks.py
Created August 22, 2023 13:44
Python ML Chunking Algorithm
from sentence_transformers import SentenceTransformer, util
from torch import Tensor
from sklearn.metrics.pairwise import cosine_similarity
from scipy.signal import argrelextrema
import numpy as np
import math
import constants as C
import openai
import os
import json
@loganpowell
loganpowell / graphql-args-passing.md
Last active June 8, 2023 17:51
GraphQL Passing Arguments (parent, args, context, info)
@loganpowell
loganpowell / require-in-webworker.js
Last active May 7, 2023 19:55
Using RequireJS in Web Worker
// See documentation: https://requirejs.org/docs/api.html#webworker
// working example: https://jsfiddle.net/yojaar80/2/
// from SO: https://stackoverflow.com/questions/36840329/whats-the-right-way-to-use-require-js-with-web-workers
importScripts("require.js");
requirejs.config({
//Lib path
baseUrl: '.',
@loganpowell
loganpowell / jsdom-prerender.js
Created April 27, 2023 12:49 — forked from lovetingyuan/jsdom-prerender.js
use jsdom to prerender simple page.
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const path = require('path')
const fetch = require('node-fetch')
const finalhandler = require('finalhandler')
const http = require('http')
const serveStatic = require('serve-static')
function createServer (port, root = path.join(__dirname, 'dist')) {
const serve = serveStatic(root)
@loganpowell
loganpowell / styled-animated.md
Created January 15, 2018 21:00
Styled-Components with Animated.js (for React Native, but...)

React Native

styled-components has a ReactNative mode that works exactly the same, except you import the things from styled-components/native:

import styled from 'styled-components/native';

const StyledView = styled.View`
  background-color: papayawhip;
@loganpowell
loganpowell / GFM.md
Created January 23, 2020 03:32
GFM example

Features

  • Support Standard Markdown / CommonMark and GFM(GitHub Flavored Markdown);
  • Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...;
  • Markdown Extras : Support ToC (Table of Contents), Emoji, Task lists, @Links...;
  • Compatible with all major browsers (IE8+), compatible Zepto.js and iPad;
  • Support identification, interpretation, fliter of the HTML tags;
  • Support TeX (LaTeX expressions, Based on KaTeX), Flowchart and Sequence Diagram of Markdown extended syntax;
  • Support AMD/CMD (Require.js & Sea.js) Module Loader, and Custom/define editor plugins;
@loganpowell
loganpowell / styled-components-react-container-query.js
Last active November 10, 2022 19:48
Styled-component with react-container-query
// from: https://github.com/styled-components/styled-components/issues/416#issuecomment-276230181
import React from 'react';
import classnames from 'classnames';
import styled from 'styled-components';
import { ContainerQuery } from 'react-container-query';
const query = {
'box1': {
minWidth: 250,
@loganpowell
loganpowell / batch_svg_optimize.bat
Last active November 5, 2022 19:40
batch process all svg files in containing folder with scour (Windows `.bat` file)
@Echo off
setlocal ENABLEDELAYEDEXPANSION
echo.
echo This script runs through all the .svg files in the folder within which this file is contained and outputs an optimized version to the 'out' folder here...
:: echo (type q to quit at any question)
echo.
:: count how many files we need to convert before converting!
set /a total=0