Skip to content

Instantly share code, notes, and snippets.

@jimfrenette
jimfrenette / docker-compose.yml
Last active October 5, 2018 01:25
local dev docker-compose file for wordpress site
version: "2"
services:
mariadb:
# image: wodby/mariadb:10.2-3.0.2
image: wodby/mariadb:10.1-3.0.2
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
# http://serverfault.com/questions/95431
function Test-Administrator {
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
function prompt {
# https://github.com/dahlbyk/posh-git/wiki/Customizing-Your-PowerShell-Prompt
$origLastExitCode = $LastExitCode
Write-VcsStatus
# SSH Agent Functions
# Mark Embling (http://www.markembling.info/)
#
# How to use:
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice)
# - Import into your profile.ps1:
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes]
# - Enjoy
#
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin.
@jimfrenette
jimfrenette / profile.ps1
Last active July 7, 2017 22:49
My custom PowerShell profile, dependent upon ssh-agent-utils: https://gist.github.com/jimfrenette/21bfaed5708561014da3f075e076e814
# http://joonro.github.io/blog/posts/powershell-customizations.html
# http://serverfault.com/questions/95431
function Test-Administrator {
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
function prompt {
# https://github.com/dahlbyk/posh-git/wiki/Customizing-Your-PowerShell-Prompt
@jimfrenette
jimfrenette / browser-detection.js
Created June 7, 2017 00:54
A module for browser detection
export default class BrowserDetection {
constructor() {
this.browser = this.searchString(this.dataBrowser) || "Other";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
var root = document.getElementsByTagName( 'html' )[0];
root.className += ' ' + this.browser;
root.className += ' ' + this.version;
@jimfrenette
jimfrenette / Dockerfile
Last active May 3, 2017 22:09
LAMP Dockerfile with open ssh server, ssl, phpmyadmin, etc.
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
# Install packages.
RUN apt-get update
RUN apt-get install -y \
nano \
apache2 \
php5-cli \
php5-mysql \
@jimfrenette
jimfrenette / Homestead.yaml
Created March 21, 2017 00:36
Sample Laravel Homestead config
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
@jimfrenette
jimfrenette / docker-compose.yml
Last active March 23, 2017 02:31
two wordpress sites, nginx-proxy, mariadb, and phpmyadmin. uses official WordPress container from hub.docker.com
version: "2"
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
db:
@jimfrenette
jimfrenette / UtilityMenuExample.ps1
Last active February 19, 2017 17:26
PowerShell Script with menu and utility functions to demonstrate env: and other system variables
function ListProcess
{
Get-Process | Group-Object Company | Sort-Object Count -Descending
}
function ListEnvVars
{
Get-ChildItem env:
}
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true