Skip to content

Instantly share code, notes, and snippets.

@cmckni3
cmckni3 / deploy-github-pages.yml
Created January 31, 2024 04:49
GitHub Actions GitHub Pages template
name: Deploy presentation to GitHub pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@cmckni3
cmckni3 / setup-rubymotion.sh
Created January 3, 2024 20:14
Reset RubyMotion XCode and Clean build project
# Install XCode before running any commands below
# Setup RubyMotion and XCode
cp -r /usr/lib/swift/*.dylib /Applications/Xcode.app/Contents/Frameworks/
touch /Applications/Xcode.app/Contents/Frameworks/.swift-5-staged
sudo xcodebuild -license accept
sudo xcode-select --install
sudo xcode-select --reset
# In project directory run commands to build
@cmckni3
cmckni3 / font-awesome-pro.scss
Created September 10, 2019 17:35
Font Awesome Pro SCSS
$fa-font-path: '~@fortawesome/fontawesome-pro/webfonts';
@import '~@fortawesome/fontawesome-pro/scss/fontawesome';
@import '~@fortawesome/fontawesome-pro/scss/solid';
@import '~@fortawesome/fontawesome-pro/scss/regular';
@import '~@fortawesome/fontawesome-pro/scss/brands';
<!-- Sample Content to Plugin to Template -->
<h1>CSS Basic Elements</h1>
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr />
<h1 id="headings">Headings</h1>
<h1>Heading 1</h1>
@cmckni3
cmckni3 / package-clis-using-gluegun-pkg.md
Last active January 30, 2024 22:22
Package TypeScript CLIs with zeit/pkg

TypeScript & zeit/pkg

zeit/pkg needs to know which assets to include for TypeScript (tsconfig.json) and be able to resolve any dynamic requires.

This package.json shows how to configure zeit/pkg with gluegun.

In this example, the assets key is used for pkg to copy necessary files into the built binary and resolve the dynamic requires to find extensions and commands. TypeScript requires some basic type definitions (*.d.ts files) to compile and run which are included with the TypeScript compiler.

@cmckni3
cmckni3 / angular-debugger-vs-code.md
Last active August 28, 2024 18:20
Visual Studio code debugger configuration @angular/cli
  1. Install node.js and optionally yarn
  2. Install and open Visual Studio Code
  3. Install chrome debugging extension for Visual Studio Code
  4. Install @angular/cli npm i -g @angular/cli OR yarn global add @angular/cli
  5. Create a new project ng new my-project
  6. Open project in Visual Studio Code
  7. Debug > Add configuration
  8. Paste contents of launch.json into the new launch.json configuration file.
  9. Start project ng serve optionally changing the port with -p <value> or --port. Remember to change the port in launch.json first since Visual Studio Code will reload and stop all programs running in the builtin terminal.
  10. Debug > Launch Chrome agains
@cmckni3
cmckni3 / humble-bundle-download.js
Last active January 30, 2024 22:29
Download humble bundle items
// Requires jQuery
// Paste into console
$('a[download]').toArray().map((a, index) => {
// delay by index seconds to prevent overloading browser on large bundles
return setTimeout(() => {
// simulate click event to trigger download
a.click();
}, index * 1000)
});
@cmckni3
cmckni3 / get-event-listeners.js
Last active July 5, 2019 08:56
Get all event listeners on page
window.getAllEventListeners = () => {
return Array.from(document.querySelectorAll('*')).map(element => {
const listeners = getEventListeners(element);
return {
element: element,
listeners: Object.keys(listeners).map(key => {
return {
event: key,
@cmckni3
cmckni3 / app.module.ts
Last active February 22, 2017 21:33
Angular 2 ngrx/store HMR
import 'rxjs/add/operator/take';
import {
Action,
ActionReducer,
combineReducers,
Store,
StoreModule
} from '@ngrx/store';
import { compose } from '@ngrx/core/compose';
@cmckni3
cmckni3 / mac-commands.md
Last active January 26, 2024 01:32
Helpful Mac commands

Clear software updates (useful after turning off beta updates)

sudo softwareupdate --clear-catalog

Allow running software by unidentified developers

sudo spctl --master-disable