Skip to content

Instantly share code, notes, and snippets.

View MatthewKosloski's full-sized avatar
📖
Always Learning

Matthew Kosloski MatthewKosloski

📖
Always Learning
View GitHub Profile
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { OnInit } from '@angular/core';
import { map } from 'rxjs/operators';
import { Observable } from 'rxjs';
interface Todo {
userId: number
id: number
title: string

Modules

  • An NgModule declares a compilation context for a set of components that is dedicated to an application domain, a workflow, or a closely related set of capabilities.
  • An NgModule can associate its components with related code, such as services, to form functional units.
  • The root module, AppModule, typically resides in a file named app.module.ts.

Metadata

An NgModule is defined by a class with the @NgModule() decorator, which is a function that tkaes a single metadata object. Some of the most important properties are:

  • declarations: The components, directives, and pipes that belong to the module.
  • exports: The subset of declarations that should be visible in the component templates of other modules.
  • imports: Other modules whose exported classes are needed by component templates declared in this module.
@MatthewKosloski
MatthewKosloski / ssh_cheatsheet.md
Last active December 12, 2021 07:07
SSH Cheatsheet

SSH Cheatsheet

You know how it goes. SSH is something that nearly every developer uses every day, however, they only set it up a couple of times and then forget about it. And whenever you need to authenticate with SSH again, you just look up how to do it, never remembering how to do it because why would you?

SSH Protocol

What is it?

SSH, which stands for Secure Shell, is a network protocol that enables a client to securely connect to a remote server. All user authentication, commands, outputs, and file transfers are encrypted to protect against attacks in the network. It is a more secure alternative to non-protected login protocols such as FTP.

@MatthewKosloski
MatthewKosloski / .vimrc
Created April 12, 2020 03:50
My Vim Configuration
" Automatically install vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Install plugins
call plug#begin()
Plug 'preservim/nerdtree'
@MatthewKosloski
MatthewKosloski / git_branch_cheatsheet.md
Last active April 19, 2018 08:11
Git Branch Cheatsheet

Branches

Creating branches

Creates a new branch:

  git branch <branchname>

Create a new branch and switch to it with the following command. Any prior commits will be a part of the branch as well as the master.

  git checkout -b <branchname>
@MatthewKosloski
MatthewKosloski / spy_and_stub.js
Last active October 16, 2016 02:32
An example of a spy and stub
import expect from 'expect';
import sinon from 'sinon';
import fetch from 'isomorphic-fetch';
describe.only('Sinon samples', () => {
describe('spy', () => {
let spy;
before(() => {
let add = (...args) => args.reduce((a, b) => a + b);
@MatthewKosloski
MatthewKosloski / repack-apps-spotify-directory.txt
Last active November 26, 2020 01:01
Repacks the Spotify modules
/*
Repacks the Spotify modules
It converts your folder into a .spa file. (e.g., profile -> profile.spa)
All module folders will be deleted after running this.
As a result, the root directory will only contain .spa files. (ready to be placed into Spotify's contents)
To run, simply `cd` into the root Apps folder of your skin.
Then, take said folder and replace it with Spotify's Apps directory found at `/Applications/Spotify.app/Contents/Resources/Apps`
@MatthewKosloski
MatthewKosloski / extract-apps-spotify-directory.txt
Last active April 6, 2021 11:20
Extracts each .spa file in Spotify's Apps directory without manually doing it yourself.
/*
Extracts each .spa file in Spotify's Apps directory without manually doing it yourself.
The default folder is put on the desktop.
To change that, change the following part of the command:
`~/Desktop/Apps && cd ~/Desktop/Apps`
Procedure:
1. Change directory to /Applications/Spotify.app/Contents/Resources/Apps
2. Copy the files within the directory to ~/Desktop/Apps and change directory