Skip to content

Instantly share code, notes, and snippets.

View getStartOfWeek.ps1
function getStartOfWeek() {
begin {
$base = [DayOfWeek]::Monday
}
process {
$difference = $_.DayOfWeek - $base
$offset = (7 + $difference) % 7 * -1
View 12 Useful Packages Every Node.js Developer Should Know.md

Husky

Husky makes it straightforward to implement git hooks. Work with a team and want to enforce coding standards across the team? No problem! Husky lets you require everyone to automatically lint and tests their code before committing or pushing to the repository.

https://github.com/typicode/husky

dotenv

Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.

@SMoni
SMoni / README.md
Created Feb 17, 2020 — forked from addyosmani/README.md
108 byte CSS Layout Debugger
View README.md

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@SMoni
SMoni / Get-ProcessMemory.ps1
Created Dec 29, 2018 — forked from jdhitsolutions/Get-ProcessMemory.ps1
A PowerShell function to display a snapshot of process memory usage based on the workingset value. The file includes a format.ps1xml file.
View Get-ProcessMemory.ps1
Function Get-ProcessMemory {
<#
.SYNOPSIS
Get a snapshot of a process' memory usage.
.DESCRIPTION
Get a snapshot of a process' memory usage based on its workingset value. You can get the same information using Get-Process or by querying the Win32_Process WMI class with Get-CimInstance. This command uses Invoke-Command to gather the information remotely. Many of the parameters are from that cmdlet.
Technically you can use wildcards with process names, but because of how the function aggregates data, you might not see the results you expect.
.EXAMPLE
PS C:\> get-processmemory code,powershell,powershell_ise
@SMoni
SMoni / filtered-table.vue
Last active Oct 28, 2018
Spike filtering table in vue
View filtered-table.vue
<template>
<div class="filtered-table">
<table>
<thead>
<tr class="columns">
<th v-for="column in columns" :key="column.name" class="column">{{ column.text }}</th>
</tr>
<tr class="filters">
<td v-for="column in columns" :key="column.name" class="filter">
<input @input="column.setTerms($event.target.value)"/>
@SMoni
SMoni / Chain.cs
Last active Oct 9, 2015
Simple Chaining... nothing more
View Chain.cs
class Chain<T> {
private Chain() { }
private readonly List<T> _Chain = new List<T>();
public static Chain<T> Start => new Chain<T>();
public Chain<T> this[T This_] {
get { this._Chain.Add(This_); return this; }
View F# Game of life
(*
F# Game of life
Philip Jander
@ph_j
2015
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
https://creativecommons.org/licenses/by-nc-sa/3.0/
*)
View IntegerArrayToString.Test.rb
require "test/unit"
require "./IntegerArrayToString.rb"
class Suite < Test::Unit::TestCase
Array.include IntegerArrayToString
def test_GetArrayAsString
randomNumber = Random.new.rand(1..100)
View SoftwareArchitecure.md

Software architecture encompasses the set of significant decisions about the organization of a software system including the selection of the structural elements and their interfaces by which the system is composed; behavior as specified in collaboration among those elements; composition of these structural and behavioral elements into larger subsystems; and an architectural style that guides this organization. Software architecture also involves functionality, usability, resilience, performance, reuse, comprehensibility, economic and technology constraints, tradeoffs and aesthetic concerns.

Philippe Kruchten, Grady Booch, Kurt Bittner, and Rich Reitman

The highest-level breakdown of a system into its parts; the decisions that are hard to change; there are multiple architectures in a system; what is architecturally significant can change over a system's lifetime; and, in the end, architecture boils down to whatever the important stuff is.

Patterns of Enterprise Application Architecture, Martin Fowler

You can’t perform that action at this time.