Skip to content

Instantly share code, notes, and snippets.

View nhalstead's full-sized avatar
👨‍💻
Something. Maybe cool

Noah Halstead nhalstead

👨‍💻
Something. Maybe cool
View GitHub Profile
@osopolar
osopolar / com.user.time-machine-exclude-node-modules-job.plist
Last active December 20, 2022 08:44 — forked from peterdemartini/command.sh
Exclude node_modules (and more) from timemachine, use launchd to scan the Project directory on a regular basis, for example meanwhile you are having siesta. Put this file in ~/Library/LaunchAgents and call `launchctl load ~/Library/LaunchAgents/com.user.time-machine-exclude-node-modules-job.plist`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.time-machine-exclude-node-modules-job</string>
<key>RunAtLoad</key>
<false/>
<key>KeepAlive</key>
<false/>
@nickcernis
nickcernis / readme.md
Last active April 27, 2025 12:51
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@nullthoughts
nullthoughts / SimpleXMLExtended.php
Created August 11, 2018 17:09
Extends SimpleXMLElement to support writing CDATA
<?php
class SimpleXMLExtended extends SimpleXMLElement
{
// Inspired by: https://stackoverflow.com/questions/6260224/how-to-write-cdata-using-simplexmlelement/6260295
public function addCDATA($string)
{
$node = dom_import_simplexml($this);
$nodeOwner = $node->ownerDocument;
@nhalstead
nhalstead / NATO-Alphabet-converter.php
Last active December 29, 2018 01:05
Take a regular string and convert it into a NATO Alphabet Message
<?php
const NATOAlphabet = array(
"A" => "Alfa",
"B" => "Bravo",
"C" => "Charlie",
"D" => "Delta",
"E" => "Echo",
"F" => "Foxtrot",
"G" => "Golf",
<?php
namespace App\Models\Traits;
use Carbon\Carbon;
use Cron\CronExpression;
use InvalidArgumentException;
/**
* @property CronExpression|null $cron_expression
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active April 30, 2025 12:33
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@benwattsjones
benwattsjones / gmail_mbox_parser.py
Last active April 10, 2025 20:35
Quick python code to parse mbox files, specifically those used by GMail. Extracts sender, date, plain text contents etc., ignores base64 attachments.
#! /usr/bin/env python3
# ~*~ utf-8 ~*~
import mailbox
import bs4
def get_html_text(html):
try:
return bs4.BeautifulSoup(html, 'lxml').body.get_text(' ', strip=True)
except AttributeError: # message contents empty
@smartdeal
smartdeal / Wordpress_Menu_add_item.php
Last active May 8, 2018 15:53
[Add Custom Items to Specific WordPress Menus] #Wordpress #WP_Menu
<?php
add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
function add_loginout_link( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'primary') {
$items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>';
}
elseif (!is_user_logged_in() && $args->theme_location == 'primary') {
$items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
}
@sumect
sumect / wpstest.ino
Created May 8, 2018 15:50 — forked from copa2/wpstest.ino
Example for WPS connection with https://github.com/esp8266/Arduino
#include <ESP8266WiFi.h>
void setup() {
Serial.begin(115200);
delay(1000);
Serial.printf("\nTry connecting to WiFi with SSID '%s'\n", WiFi.SSID().c_str());
WiFi.mode(WIFI_STA);
WiFi.begin(WiFi.SSID().c_str(),WiFi.psk().c_str()); // reading data from EPROM, last saved credentials
while (WiFi.status() == WL_DISCONNECTED) {
@knownasilya
knownasilya / README.md
Last active May 8, 2018 16:06 — forked from thoov/user.hbs
Thought exercise on "Ember Controllerless"

@model, @action and @service basically expose the underlying thing that they decorate to the component set by @associatedComponent (which is made up and not a great name).

I can also see something like @model({ pauseRendering: false }) and @model({ waitForParent: false }) for the data loading.