Skip to content

Instantly share code, notes, and snippets.

View mklarsen's full-sized avatar
🤔
curious and, perfectionist

Martin Kraus Larsen mklarsen

🤔
curious and, perfectionist
  • Maersk | EB | Tryg | Kilroy | eficode Mbc | eficode-praqma
  • Copehagen
  • 10:49 (UTC +02:00)
View GitHub Profile
@mklarsen
mklarsen / demo.md
Created September 24, 2020 06:49 — forked from danharper/demo.md
Open native Maps apps on iOS and Android in Cordova
iOS (with pin, iOS will lookup address too and show that as label)
maps://?q=LAT,LNG
Android, no pin (just open at location)
geo:LAT,LNG
{
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q) -f
docker volume prune -f
docker network prune -f
docker system prune -a -f
}
git config --global user.name "Full Name"
git config --global user.email "[email protected]"
#####################
## Start in master ##
#####################
git checkout master
git pull
@mklarsen
mklarsen / nginx.conf
Created June 12, 2018 11:09 — forked from taddev/nginx.conf
Nginx reverse proxy to Exchange 2010/2013
server {
listen 80;
#listen [::]:80;
server_name mail.gwtest.us autodiscover.gwtest.us;
return 301 https://$host$request_uri;
}
server {
listen 443;
#listen [::]:443 ipv6only=on;
@mklarsen
mklarsen / nginx.conf
Created June 12, 2018 10:52 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@mklarsen
mklarsen / dnsFlushmacOS
Created June 12, 2018 10:39
Flush DNS cache on mac 10.13.4 (macOS High Sierra)
sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache
@mklarsen
mklarsen / nginx-green-config
Created June 12, 2018 10:06
Green ngix config (proxy for ex. docker container)
# Ngix green proxy config
# save as /etc/nginx/sites-available/green
server {
listen 80 default_server;
root /var/www/html;
index index.html;
server_name _;
@mklarsen
mklarsen / nginx-blue-config
Created June 12, 2018 10:05
Blue ngix config (proxy for ex. docker container)
# Ngix blue proxy config
# save as /etc/nginx/sites-available/blue
server {
listen 80 default_server;
root /var/www/html;
index index.html;
server_name _;
@mklarsen
mklarsen / switchDeploy.sh
Created June 12, 2018 10:01
Switch to switch Ngix (blue / green - deploy) proxy
#!/bin/bash
##########################################
# Cfg
blue="/etc/nginx/sites-enabled/blue"
green="/etc/nginx/sites-enabled/green"
# Functions
reloadNg (){
/etc/init.d/nginx restart
}
@mklarsen
mklarsen / generateAppIcon.sh
Created June 5, 2018 17:47 — forked from benvium/generateAppIcon.sh
Generate app icons and xcassets file from a single image. To use this, place script in `appname` folder inside your project (i.e. the folder that Xcode generates for you containing your source code, it's named after whatever you called the app). Create folder there called `RawImages`. Source icon should 1024x1024 and be called appIcon.png. If th…
#!/bin/bash -e
# --------------------------------------------------------
# Generate app icons and xcassets file from a single image
# Ben Clayton, Calvium Ltd.
# --------------------------------------------------------
# To use this, place script in `appname` folder inside your project (i.e. the folder that Xcode generates for you containing your source code, it's named after whatever you called the app).
# Create folder there called `RawImages`.
# Source icon should 1024x1024 and be called appIcon.png. If the icon changes, you can just run this again to regenerate everything.
# This script assumes that you have the default setup of an Images.xcassets file containing the AppIcon.appiconset.