This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://dotnetthoughts.net/how-to-host-your-aspnet-core-in-a-windows-service/ | |
public static void Main(string[] args) | |
{ | |
var host = new WebHostBuilder() | |
.UseIISIntegration() | |
.UseKestrel() | |
.UseContentRoot(@"Path\To\Content\Root") | |
.UseStartup<Startup>() | |
.Build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defaults | |
# ======== | |
# see also https://raw.githubusercontent.com/pi-hole/pi-hole/master/adlists.default | |
# Hosts-file.net | |
# https://hosts-file.net/ad_servers.txt | |
hosts-file.net | |
# MalwareDomains | |
# https://mirror1.malwaredomains.com/files/justdomains |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This is a directory/file filter template for WinMerge | |
name: Git-Repository | |
desc: Suppresses the hidden .git Folder which contains the (lokal) repository | |
## Select if filter is inclusive or exclusive | |
## Inclusive (loose) filter lets through all items not matching rules | |
## Exclusive filter lets through only items that match to rule | |
## include or exclude | |
def: include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
#### | |
# Helper script to update the Last modified timestamp of files in a Git SCM | |
# Projects working Copy | |
# | |
# When you clone a Git repository, it sets the timestamp of all the files to the | |
# time when you cloned the repository. | |
# | |
# This becomes a problem when you want the cloned repository, which is part of a | |
# Web application have a proper cacheing mechanism so that it can re-cache files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show & Hide hidden files (1) | |
defaults write com.apple.finder AppleShowAllFiles -bool YES | |
defaults write com.apple.finder AppleShowAllFiles -bool NO | |
Show & Hide hidden files (2) | |
defaults write com.apple.finder AppleShowAllFiles 1 && killall Finder | |
Display full Path in OS X Finder title Bar | |
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=UTF-8 | |
import math, subprocess | |
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE) | |
output = p.communicate()[0] | |
o_max = [l for l in output.splitlines() if 'MaxCapacity' in l][0] | |
o_cur = [l for l in output.splitlines() if 'CurrentCapacity' in l][0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZSH_THEME_GIT_PROMPT_PREFIX="[git:" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color" | |
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]+" | |
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]" | |
function git_prompt_info() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domains = { :de => "DEU", :no => "NOR", :us => "US" } | |
domains.each_pair { |k, v| puts "Key: #{k}, Value: #{v}" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1 = ["a", 1, "b", 2] | |
h1 = Hash[*a1] | |
puts "a1=" + a1.to_s | |
puts "h1=" + h1.to_s | |
a2 = [["a", 1], ["b", 2]] | |
h2 = Hash[*a1] #splat operator (*) used | |
puts "a2=" + a2.to_s | |
puts "h2=" + h2.to_s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
counter = 1 | |
file = File.new($0, "r") | |
while (line = file.gets) | |
if line.include?("line") | |
puts "#{counter}: #{line}" | |
end | |
counter += 1 | |
end |