Skip to content

Instantly share code, notes, and snippets.

View stephensmitchell's full-sized avatar
🎯
Focusing

Stephen S. Mitchell stephensmitchell

🎯
Focusing
View GitHub Profile
@stephensmitchell
stephensmitchell / create-png.sh
Last active January 10, 2023 16:46 — forked from osuka/create-png.sh
Create hi-res versions of images with Inkscape and Crop them with Gimp
#!/bin/bash
howmany=`ls *.svg|wc -l`
if [ $howmany -eq 0 ] ; then
echo "Please launch this from inside a folder with svg files."
exit
fi
# In Mac OS X scripting only works when invoked with FULL PATH
@stephensmitchell
stephensmitchell / NodeGraph.cpp
Created February 5, 2021 05:08 — forked from spacechase0/NodeGraph.cpp
ImGui node graph
#include <any>
#include <cmath>
#include <imgui.h>
#include <imgui_internal.h>
#include "NodeGraph.hpp"
namespace
{
@stephensmitchell
stephensmitchell / AutoHotKey script - Always-on-top.ahk
Created January 29, 2021 08:22 — forked from gustavomdsantos/AutoHotKey script - Always-on-top.ahk
AutoHotKey script that make any window Always-on-Top on Windows.
; Press Ctrl+Shift+Space to set any currently active window to be always on top.
; Press Ctrl+Shift+Space again set the window to no longer be always on top.
; Source: https://www.howtogeek.com/196958/the-3-best-ways-to-make-a-window-always-on-top-on-windows
^+SPACE::
WinGetTitle, activeWindow, A
if IsWindowAlwaysOnTop(activeWindow) {
notificationMessage := "The window """ . activeWindow . """ is now always on top."
notificationIcon := 16 + 1 ; No notification sound (16) + Info icon (1)
}
import inspect
""" var_dump('vars') module to dump variables (python 3.6+: uses f strings)"""
def var_dump(var_list_str):
""" print variables in callers scope indicated in space delimited string param"""
# retrieve information needed on callers frame
prev_frame = inspect.currentframe().f_back
frame_info = inspect.getframeinfo(prev_frame)
import inspect
""" var_dump('vars') module to dump variables (python 3.6+: uses f strings)"""
def var_dump(var_list_str):
""" print variables in callers scope indicated in space delimited string param"""
# retrieve information needed on callers frame
prev_frame = inspect.currentframe().f_back
frame_info = inspect.getframeinfo(prev_frame)
@stephensmitchell
stephensmitchell / blender28_run_qt_ui.py
Created December 11, 2020 13:01 — forked from BigRoy/blender28_run_qt_ui.py
Simple example of running a Qt interface in Blender 2.8 without blocking Blender.
import bpy
from PyQt5 import QtWidgets
class QtModalOperator(bpy.types.Operator):
"""A base class for Operators that run a Qt interface."""
def modal(self, context, event):
if self._app:
@stephensmitchell
stephensmitchell / Spell_Check.ahk
Created November 1, 2020 23:34
A spell check to run in background
#Notrayicon
#NoEnv ; For security
#SingleInstance, Force
#Persistent
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;------------------------------------------------------------------------------
; Fix for -ign instead of -ing.
; Words to exclude: (could probably do this by return without rewrite)
; From: http://www.morewords.com/e nds-with/gn/
@stephensmitchell
stephensmitchell / JuliaOctaveNumpy.md
Created September 15, 2020 08:10 — forked from AlexanderFabisch/JuliaOctaveNumpy.md
Comparison of Julia, NumPy and Octave

Comparison of Julia, Python and Octave

Overview

Julia is a new languange for technical computing. It is a mix of R, Matlab, Python and other similar languages. Its main advantage is its speed: it is just in time (JIT) compiled and almost as fast as C. Another advantage is its type inference, i.e. you do not have to specify types (although you can), but all variables are statically typed. It is a high level language that is fast as well. Here I compare the behavior to similar

@stephensmitchell
stephensmitchell / Articles.svelte
Created September 12, 2020 11:29 — forked from praveenweb/Articles.svelte
Fetch Articles using GraphQL in Svelte
<script context="module">
import gql from 'graphql-tag';
import { client } from './apollo';
const ARTICLES = gql`
{
article {
id
title
author {
@stephensmitchell
stephensmitchell / ColorConsole.cs
Created August 19, 2020 13:38 — forked from RickStrahl/ColorConsole.cs
Color Console - a simple class to add color to .NET Console commands more easily.
using System;
using System.Text;
using System.Text.RegularExpressions;
namespace MainColorConsole
{
class Program
{
static void Main(string[] args)
{