Skip to content

Instantly share code, notes, and snippets.

View css-test-page.html
<!-- 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 / README.md
Created Mar 21, 2018
Package TypeScript CLIs with zeit/pkg
View README.md

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 / README.md
Last active Jun 28, 2017
Visual Studio code @angular/cli
View README.md
  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 / download.js
Created Feb 23, 2017
Download humble bundle items
View download.js
// Requires jQuery
// Paste into console
$('a[download]').toArray().map((a, index) => {
// delay by index seconds
return setTimeout(() => a.click(), index * 1000)
});
@cmckni3
cmckni3 / get-event-listeners.js
Last active Jul 5, 2019
Get all event listeners on page
View get-event-listeners.js
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 / compile.sh
Created Jan 25, 2017
Compile OpenSSL from Sourcee
View compile.sh
curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz.asc
curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz
gpg --verify openssl-1.0.1b.tar.gz.asc
tar xvzf openssl-1.0.1b.tar.gz
cd openssl-1.0.1b
perl ./Configure shared zlib --prefix=/opt/local darwin64-x86_64-cc
make
make test
sudo make install
@cmckni3
cmckni3 / app.module.ts
Last active Feb 22, 2017
Angular 2 ngrx/store HMR
View app.module.ts
import 'rxjs/add/operator/take';
import {
Action,
ActionReducer,
combineReducers,
Store,
StoreModule
} from '@ngrx/store';
import { compose } from '@ngrx/core/compose';
@cmckni3
cmckni3 / commands.md
Last active Oct 12, 2016
Helpful Mac commands
View commands.md

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 / rails_resources.md
Created Sep 28, 2016 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.
View rails_resources.md

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 / python_resources.md
Created Sep 28, 2016 — forked from jookyboi/python_resources.md
Python-related modules and guides.
View python_resources.md

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