Skip to content

Instantly share code, notes, and snippets.

View whazzmaster's full-sized avatar
:shipit:
Re-architect the world

Zachery Moneypenny whazzmaster

:shipit:
Re-architect the world
View GitHub Profile
# Pre
Disable-UAC
# System-level configuration
Disable-BingSearch
Disable-GameBarTips
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -Lock
Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -AlwaysShowIconsOn
# Boxstarter Script (Windows scripted deployment)
# github.com/whazzmaster
#
# Install Boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# Set: Set-ExecutionPolicy RemoteSigned
# Then: Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots
#
# Leverages:
@whazzmaster
whazzmaster / fuz.sh
Created December 7, 2017 16:11 — forked from BaseCase/fuz.sh
#!/usr/bin/env bash
set -e
main() {
previous_file="$1"
file_to_edit=`select_file $previous_file`
if [ -n "$file_to_edit" ] ; then
"$EDITOR" "$file_to_edit"
main "$file_to_edit"
@whazzmaster
whazzmaster / launch.json
Last active October 23, 2017 18:21
golang vscode launch configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch tests",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}"
},
@whazzmaster
whazzmaster / .babelrc
Created October 5, 2017 15:40
ES6 Debugging: .babelrc
{
"presets": [
["env", {
"targets": {"node": "8.0"},
"useBuiltIns": true
}]
],
"plugins": [
"transform-object-rest-spread"
]
@whazzmaster
whazzmaster / app
Created October 5, 2017 14:34
ES6 Debugging: app
#!/usr/bin/env node
require('./app.js');
@whazzmaster
whazzmaster / launch.json
Created October 5, 2017 14:12
ES6 Debugging: launch.json
{
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "launch",
"name": "Debug Increment Command",
"cwd": "${workspaceRoot}",
"sourceMaps": true,
"preLaunchTask": "npm: build",
"program": "${workspaceRoot}/dist/bin/app",
@whazzmaster
whazzmaster / package.json
Last active October 5, 2017 15:39
ES6 Debugging: package.json
{
"name": "incrementor",
"version": "1.0.0",
"description": "increment",
"main": "dist/cloud.js",
"private": true,
"scripts": {
"build:lib": "BABEL_ENV=lib $(npm bin)/babel src/ --ignore=src/__mocks__ --out-dir=dist --source-maps",
"build:bin": "BABEL_ENV=cli $(npm bin)/babel src/bin/ --out-dir=dist/bin --copy-files --source-maps",
"build": "rm -rf dist/ && npm run build:lib && npm run build:bin",
@whazzmaster
whazzmaster / app.js
Last active October 5, 2017 15:38
ES6 Debugging: Application
import Cloud from '../cloud';
import program from 'commander';
let command, value;
const INC_CMD = 'increment';
const DEC_CMD = 'decrement';
program
.description('online incrementer: increment cloud-based counters')
.arguments('<cmd> [args]')
@whazzmaster
whazzmaster / update.ex
Created September 20, 2017 15:02
Associating Two Records in a Many-to-Many Relationship
defmodule Identity do
# ...
defp link_user_and_company(user = %User{}, company = %Company{}) do
user = Repo.preload(user, :companies)
companies = user.companies ++ [company]
|> Enum.map(&Ecto.Changeset.change/1)
user
|> Ecto.Changeset.change