Skip to content

Instantly share code, notes, and snippets.

View MichalGrzegorzak's full-sized avatar

Michal Grzegorzak MichalGrzegorzak

  • UK
View GitHub Profile
@kunstloch
kunstloch / _windows-10-home-docker-toolbox-wordpress-mysql-with-volume.md
Last active December 5, 2020 01:02
Setting up WordPress and MySQL on Windows 10 Home (Docker Toolbox)
  1. Set up a docker-compose.yaml file (file content at the bottom of this page).

  2. Also create a data/mysql folder in your project.

  3. In order to set up a volume for MySQL in Docker Toolbox, we will need a VirtualBox Shared Folder, just like mentioned in Fixing Volumes in Docker Toolbox.

    VirtualBox by default has a c/Users Shared Folder that we can use for this (as long as your project is within C:\Users. Verify that this shared folder is set up properly:

    Capture

  4. Add a new volume to the mydatabase service in the docker-compose.yaml for the database files. Because we are using docker-toolbox and VirtualBox, we need an absolute path, starting with //c/:

    volumes:
  • //c/Users/your_username/projects/wordpress-docker-stack/data/mysql:/var/lib/mysql
#CHECK THE PATH ON LINE 2 and the FEED on LINE 3
cd "C:\users\scott\Downloads"
$a = ([xml](new-object net.webclient).downloadstring("https://channel9.msdn.com/Series/CSharp-101/feed/mp4"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[-1]
$file
if (!(test-path $file)) {
(New-Object System.Net.WebClient).DownloadFile($url, $file)
}
@jraps20
jraps20 / build.yml
Created August 12, 2019 17:57
Cache NuGet Packages with Cache Task in Azure DevOps YAML
- powershell: | # generates a hash of all packages.config and saves each on a single line on 'hash.txt'
Get-FileHash -Algorithm MD5 -Path (Get-ChildItem packages.config -Recurse) >> hash.txt
Write-Host "Hash File saved to $pwd\hash.txt"
workingDirectory: src
displayName: 'Calculate and save packages.config hash'
- task: CacheBeta@0 # speed up builds by caching packages folder
inputs:
key: nuget|1|$(Agent.OS)|$(Build.SourcesDirectory)\src\hash.txt # hash map generated in previous step
path: $(Build.SourcesDirectory)\src\packages
@phillippelevidad
phillippelevidad / InjectionFixture.cs
Created March 27, 2019 20:11
xUnit: add Startup to test project and reuse configurations
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using System;
using System.Net.Http;
namespace Tests
{
public class InjectionFixture : IDisposable
{
private readonly TestServer server;
@codingawayy
codingawayy / deploy-sqlproj
Last active April 2, 2019 08:16
MSDeploy script
msbuild "MyApp.Database/MyApp.Database.sqlproj" `
/t:"Build;Publish" `
/p:SqlPublishProfilePath="MyApp.Database.automated-tests.publish.xml" `
/p:UpdateDatabase=True `
/p:PublishScriptFileName="publish-script.sql"
@JonCubed
JonCubed / box.ps1
Last active February 11, 2020 02:21
Testing Boxstarter configuration
<#
#OPTIONAL
** Windows 7 **
Should upgrade to WMF 5 first for reduced errors
https://www.microsoft.com/en-us/download/details.aspx?id=50395
# If Dev Machine
[Environment]::SetEnvironmentVariable("BoxStarter:InstallDev", "1", "Machine") # for reboots
# This script configures IIS application pool and app.
# example usage:
# PS> init-server.ps1 -AppName MyApp -TargetComputers computer1,computer2 -PSSessionUser $(PSSessionUser) -PSSessionPassword $(PSSessionPassword) -AppPoolUser $(AppPoolUser) -AppPoolPassword $(AppPoolPassword)
param(
[Parameter(Mandatory=$true)][string]$AppName,
[string]$TargetComputers,
[string]$PSSessionUser,
[string]$PSSessionPassword,
[string]$AppPoolUser,
@slovely
slovely / maps.js
Created January 27, 2016 22:13
OverlappingFeatureSpiderfier.js example
<html>
<head>
<style type="text/css">
html, body { height: 100%; margin: 0; padding: 0; }
#map { height: 100%; }
</style>
</head>
<body>
@codingawayy
codingawayy / server-setup.ps1
Last active April 2, 2019 08:17
This script configures IIS application pool and site. It needs to be run once on each machine where the app is deployed. Run it in powershell with admin rights. For example to deploy release config run `server-setup.ps1 -Target release`
# This script configures IIS application pool and site.
# This script needs to be run once on each machine where the app is deployed.
# Run this file in powershell with admin rights. For example to deploy release config:
# PS > server-setup.ps1 -Target release
param (
[Parameter(Mandatory=$true,
HelpMessage="Name of the build (e.g. - local, debug, release, etc)")]
[string]$Target
)
@codingawayy
codingawayy / Resources.tt
Last active January 11, 2024 16:00
T4 template to generate list of files that are part of the project. This template is useful for generating list of css/js resources to be put in bundle. The value comes from the fact that files which are not part of the project (e.g. - excluded files) will not actually be included in the resulting list.
// This is an auto-generated file.
<#@ template language="C#" hostSpecific="true" debug="True" #>
<#@ output extension="cs" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDte" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="System" #>