Skip to content

Instantly share code, notes, and snippets.

View natemoo-re's full-sized avatar
⌨️
Clickity clacking away

Nate Moore natemoo-re

⌨️
Clickity clacking away
View GitHub Profile
@natemoo-re
natemoo-re / machine.js
Last active January 9, 2020 18:23
Generated by XState Viz: https://xstate.js.org/viz
const { cancel } = actions;
const TimerMachine = Machine(
{
initial: "idle",
context: {
duration: 5000,
paused: false,
startedAt: null,
remaining: 0
@natemoo-re
natemoo-re / README.md
Last active April 12, 2025 17:54
Visual Studio Code Snippets – Common Case Transformations

Common Case Transformation Snippets

Visual Studio Code allows Snippets to perform ✨Variable Transforms✨ using Regex.

Here are some common case transformations that you can apply to your snippets. In these examples, I'm using $TM_FILENAME_BASE, but the same transformations should apply to any of the Snippet Variables.

snippets-from-delimited.json can convert filenames like my-file-name, my_file_name, my file name. If your filename is delimited by a dash, underscore, or space, these should work.

snippets-from-mixed-case.json can convert filenames like myFileName and MyFileName. If your filename is in camel or Pascal case, these should work.

@natemoo-re
natemoo-re / color-helper.scss
Created May 24, 2018 17:41
Sass utility function to make working with colors stored as CSS Variables a little nicer
@function color($name) {
@return var(unquote("--PREFIX-color-#{$name}"));
}
@natemoo-re
natemoo-re / README.md
Last active December 7, 2016 04:33
Simplify @NgModule declarations in Ionic 2

Simplify @NgModule declarations in Ionic 2

Use the ES6 spread operator ... to clean up and maintain your @NgModule declaration with ease.

Jump down to the files if you want to skip the explanation.

Instructions

  1. Under your Ionic project's src/ directory, add the following directories as needed.
    • pages/ for Ionic's Page @Components, generated with $ ionic g page <PageName>
    • providers/ for Angular's @Injectable services, generated with $ ionic g provider
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Knox Alpha Phi Omega on Twitter" />
<Content type="html">
<![CDATA[
<a class="twitter-timeline" href="https://twitter.com/APO_ABGchapter" data-widget-id="450684835200114688">Tweets by @APO_ABGchapter</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
]]>
</Content>
</Module>