Skip to content

Instantly share code, notes, and snippets.

View cmckni3's full-sized avatar

Chris McKnight cmckni3

View GitHub Profile
@cmckni3
cmckni3 / psake.md
Last active January 3, 2024 20:19
Psake notes

TeamCity and psake

What is psake

  • Open-source build automation tool
  • Powershell-based
  • Leverages existing command line knowledge
  • Replaces msbuild for most tasks

Installation

@cmckni3
cmckni3 / python_resources.md
Created September 28, 2016 18:26 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@cmckni3
cmckni3 / rails_resources.md
Created September 28, 2016 18:26 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@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
@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 / get-event-listeners.js
Last active November 28, 2024 15:53
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 / 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 / angular-debugger-vs-code.md
Last active December 31, 2024 23:17
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 / 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.

<!-- 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>