Skip to content

Instantly share code, notes, and snippets.

View michaelchadwick's full-sized avatar
🤘

Michael Chadwick michaelchadwick

🤘
View GitHub Profile
@michaelchadwick
michaelchadwick / app.module.ts
Created June 14, 2017 21:11
angular 2 testing - AppModule
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { DaveService } from './_services/dave.service';
import { HomeComponent } from './home/index';
@michaelchadwick
michaelchadwick / lpxnotes_dump.sh
Last active July 22, 2024 15:39
Extract Notes field from Logic Pro X session file (.logicx)
#!/usr/bin/env bash
## get the Notes field from a Logic Pro X project (e.g. lyrics)
function lpxnotes_dump() {
# Check if a filename is provided as an argument
if [ "$#" -ne 1 ]; then
echo "Usage: lpxnotes_dump <filename>"
else
# assuming only one Alternative
filename=$1/Alternatives/000/ProjectData
@michaelchadwick
michaelchadwick / about-this-computer.sh
Created January 9, 2024 18:29
Bash script to get OS information, as well as applications
# about: display info about current system
function about() {
# OS info
if hash neofetch 2>/dev/null; then
neofetch
else
if hash archey 2>/dev/null; then
archey -c "$1"
else
if [ -f /etc/redhat-release ]; then
@michaelchadwick
michaelchadwick / de-anagram.php
Last active June 12, 2024 17:26
Take array of words and remove any that are anagrams of any other words in array
<?php
// file has 9-letter words
// and looks like this
/*
{
"9": [
"aardvarks",
...
"xenomorph"
@michaelchadwick
michaelchadwick / filter-words.py
Last active June 25, 2024 19:58
Filter a corpus of words to remove certain ones
#!/usr/bin/env python3
"""
Filter corpus of words to remove certain ones
Current filters:
* Vulgarity (offensive words)
* Estoteria (uncommon words)
* Anagrams (re-orderings or existing words)
* By default, this is only used for pangrams (9-letter words)