Skip to content

Instantly share code, notes, and snippets.

View don-smith's full-sized avatar
🧘

Don Smith don-smith

🧘
View GitHub Profile
@don-smith
don-smith / bira-eda.zsh-theme
Created August 1, 2021 08:18
An Oh-My-Zsh theme just like the built-in bira theme that also shows the username of the current Git user
# ZSH Theme - Preview: https://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m %{$reset_color%}'
local user_symbol='#'
else
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m %{$reset_color%}'
local user_symbol='$'
fi
@don-smith
don-smith / eda-windows-setup.md
Last active July 31, 2020 10:12
How to configure your Windows 10 computer for an awesome EDA experience

Windows 10 Setup for EDA

  1. Install the Windows Subsystem for Linux
    • Control Panel -> Programs -> Turn Windows Features on or off
    • Select Windows Subsystem for Linux -> OK
    • Restart computer
  2. Install Ubuntu 20 and the Windows Terminal from the Windows Store
    • If you can't install from the Windows Store, make sure you're signing in with your Microsoft Account and have verified your device (Settings -> Accounts)
    • Also, make sure you're using the most recent version of Windows 10. On the Windows Terminal page in the Store, select System Requirements -> Update
    • Open Ubuntu and let it finish installation. If it says installing for more than 5 minutes, close the Ubuntu window and re-open it
@don-smith
don-smith / swap-caps-lock-and-ctrl.ps1
Last active April 20, 2024 11:44
A PowerShell script to swap the Caps Lock and Ctrl keys
# Script found at https://superuser.com/a/997448
# Swap details found at https://www.mavjs.org/post/swap-ctrl-and-capslock-on-windows
# Improvement provided by Davido264 in comment below
$hexified = "00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00".Split(',') | % { "0x$_"};
$kbLayout = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout';
$scancodeMap = Get-ItemProperty -Path $kbLayout -Name "Scancode Map" -ErrorAction Ignore
if ( -not $scancodeMap )
{
@don-smith
don-smith / focus-follows-mouse.ps1
Created October 21, 2019 21:03
A PowerShell script to enable X-inspired mouse behavior
# Found at https://superuser.com/a/1209478
$signature = @"
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo(int uAction, int uParam, ref
int lpvParam, int flags );
"@
$systemParamInfo = Add-Type -memberDefinition $signature -Name SloppyFocusMouse -passThru
@don-smith
don-smith / launch.json
Created August 12, 2018 10:16
VS Code debugging config for Jest testing
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand",
"--testURL='http://localhost'"
],
"console": "integratedTerminal",
@don-smith
don-smith / fixres.sh
Last active August 7, 2019 06:08
A script to fix the resolution on Linux machines when the correct resolution isn't detected
#!/bin/zsh
# This is a shell script that sets up the resolution and position of the
# external display monitors. Most computers can figure this stuff out on
# their own, but this one can't :(
#
# How to use this script:
#
# Run `xrandr` to see a list of displays ports and make note of the one's that are "connected".
# As an example, if `DP-1` is on the left, and `HDMI-2` is on the right,
@don-smith
don-smith / oo.md
Created January 24, 2018 19:50
A journey of object orientation and prototypal inheritance in JavaScript

Object-orientation (OO) in JavaScript

  • Object-orientation in general
  • Prototypal inheritance
  • Classical inheritance

Object-orientation in general

Object orientation is a paradigm or style of designing software, which models the solution into objects. Objects are constructs that include both data (called properties) and behaviour (called methods). For example, a dog object could have a hairColor and isTired properties as well as bark() and sleep() methods. By combining the data and behaviour into a single construct, it is possible for the behaviour of an object to modify the data of the object. Objects are often designed around real world objects.

@don-smith
don-smith / charlottes-web-log-layout.html
Last active October 2, 2017 02:38
The beginning of a journey from static HTML to React components
<!DOCTYPE html>
<html lang="en">
<head>
<title>Charlotte's Web Log</title>
<style>
.header, .foote {
text-align: center;
}
.body.container {
display: flex;
0xE8511ab2b61714E7bf2084A8f9663153712e8DD0
@don-smith
don-smith / eda-vs-code-setup.md
Last active August 22, 2020 21:19
VS Code settings for EDA computers

IMPORTANT: This gist should be considered archived. You can find the currently maintained instructions at https://github.com/dev-academy-programme/computer-setup.

VS Code settings for EDA computers

This setup uses a global eslint installation. VS Code will use a locally installed/project-based ESLint installation, but if it doesn't find one, it will use this global one.

The following steps are best to be applied in order.

1. Install npm packages