Skip to content

Instantly share code, notes, and snippets.

@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@KodrAus
KodrAus / Profile Rust on Linux.md
Last active November 14, 2023 17:19
Profiling Rust Applications

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

@jzohrab
jzohrab / attribute_provenance_spec.rb
Last active October 2, 2017 15:07
A quick-and-dirty Chef attribute provenance reporter using ChefSpec
# Attribute Provenance reporter
# -----------------------------
#
# Runs as a ChefSpec test and dumps two sections of data:
# 1. all attributes (data from `node.debug_value()`)
# 2. where each attribute is set. You can specify the attributes
# you want included with an ATTRS environment variable.
#
# Sample run:
#
@jeremiahsnapp
jeremiahsnapp / 01_setup_dev-lxc.md
Last active July 19, 2016 07:52
Quick Setup dev-lxc-platform
@Arcath
Arcath / Microsoft.PowerShell_profile.ps1
Last active August 29, 2015 14:16
My Powershell Profile
# Set the Location to my Powershell FOlders
set-location c:\Code\Powershell
# Fix/Set the console size
$Shell = $Host.UI.RawUI
$size = $Shell.WindowSize
$size.width=150
$size.height=50
$Shell.WindowSize = $size
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@benr
benr / gist:5505198
Created May 2, 2013 20:34
SmartOS Vagrant Box, first preview. Lacks VBox Extensions for disk sharing. (smartos-20130419T073558Z)
vagrant box add smartos http://cuddletech.com/tmp/smartos-latest.box
mkdir smartos && cd smartos
vagrant init smartos
vagrant up
vagrant ssh
@adamhjk
adamhjk / .slate
Created April 24, 2013 16:45
My slate config!
config defaultToCurrentScreen true
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
# Monitor Aliases
alias mon-laptop 0
alias mon-dell 1
# Command e shows window hints
@aphyr
aphyr / gist:5198654
Created March 19, 2013 18:17
Thoughts on configuration file complexity.

Some people think that configuration should not be "Turing complete"; others think the configuration language should be as expressive as possible--so much so that it amounts to a programming language itself.

I assert that configuration files which are not Turing complete (or, perhaps a more useful distinction, are not "sufficiently complex languages") are in practice extended to be that complex; and when that happens, the result is often more difficult to understand than if the language were more powerful to start with.

@danielsdeleo
danielsdeleo / api.rb
Last active December 14, 2015 22:29
RSpec2 Style let bindings for Chef?
##
# binding definition API.
# Examples taken from nagios cookbook
bind(:nagios_service_name).to("nagios")
bind(:hostgroups) do
search(:role, "*:*").map {|r| r.name }
end