Skip to content

Instantly share code, notes, and snippets.

@jimfrenette
jimfrenette / java.ps1
Last active June 30, 2018 21:04
Set system environment variables for Java development in Windows.
<#
.SYNOPSIS
.
.DESCRIPTION
Set system environment variables for JAVA development.
.PARAMETER Arch (a)
The JDK architecture. e.g., x64, x86 (32 bit)
.PARAMETER Name (n)
The name of the folder where the JDK is installed, e.g., jdk1.8.0_172
.EXAMPLE
@jimfrenette
jimfrenette / clean-docker-for-mac.sh
Created January 26, 2018 20:45 — forked from MrTrustor/clean-docker-for-mac.sh
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@jimfrenette
jimfrenette / laravel5.2-el6-vue2-webpack-package.json
Created November 1, 2016 00:35
NPM manifest for Laravel 5.2 with Elixir 6, Vue 2 and Webpack
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^6.0.0-11",
"laravel-elixir-vue-2": "^0.2.0",
# 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
# 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 / 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: