text 新设计管理CSS

New design management CSS
@import url('https://fonts.googleapis.com/css?family=Raleway:500,600');
h1,h2,h3,h4,h5,body, a, p, .field--type-text-with-summary, .company_profile__field--type-string-long, [data-block-internal-id="footer"] body, [data-block-internal-id="footer"] p, [data-block-internal-id="footer"] .field--type-text-with-summary, [data-block-internal-id="footer"] .company_profile__field--type-string-long {
  font-family: 'Raleway', sans-serif!important;
}



/* banner */
.view-mode-slider:before {
  background: rgba(0, 0, 0, 0.3);
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: block;
  content: '';
  position: absolute;
  width: 100%;
}


.front .orbit__container .orbit__image:after {
 
}


[data-block-internal-id="core_slider_fullscreen"] .orbit__bullets button.is-active {
  background-color: #30519d!important;
}

[data-block-internal-id="core_slider_fullscreen"] .orbit__bullets button {
  background-color: rgba(255, 255, 255, .5)!important;
}
 

/* utility */
.text-center p {
	text-align: center;
}

.embedded-entity img {
	margin-bottom: 10px;
}

.aw-content .block__title:after {
  content: ' ';
  border-top: 3px solid #a6c353;
  width: 160px;
  margin: 20px 0;
  display: inline-block;
  transform: translate(-50%,0);
  -webkit-transform: translate(-50%,0);
  left: 50%;
  position: absolute;
}

/* fix margin issue */
.front .grid--checkerboard {
  margin: 0;
}
 

/* title blocks*/
.aw-content--contrain .block__title, .aw-content--full .block__title {
	padding: 4rem 0 2rem 0;
}

/* team cards padding adjustment */
.team-member .card-divider {
  padding-bottom: 0;
}
 
.team-member .card-section {
  padding-top: 0;
}
 
 
/* nav */
@media screen and (min-width: 64em) {
  [data-block-internal-id="aw_core_visitormainmenu"] .menu-item.is-dropdown-submenu-item > a {
    color: white!important;
    background: var(--primary-color,#0a0a0a)!important;
    line-height: 1.3;
  }
  [data-block-internal-id="aw_core_visitormainmenu"] .dropdown.menu.large-horizontal > li.opens-right > .is-dropdown-submenu {
    border: none;
  }
  /* container  */
  [data-block-internal-id="aw_core_visitormainmenu"] .dropdown.menu.large-horizontal > li.is-dropdown-submenu-parent > a {
    color: white;
  }
  /* nice gradient border */
    [data-block-internal-id="aw_core_visitormainmenu"] .menu-item.is-dropdown-submenu-item > a:hover {
    background: #428bca!important;
    color: white!important;
  }
  [data-block-internal-id="aw_core_visitormainmenu"] .dropdown.menu.large-horizontal > li.opens-right > .is-dropdown-submenu {
    border: none;
    -webkit-box-shadow: 0 2px 20px 0 rgba(161,170,183,.5);
    box-shadow: 0 2px 20px 0 rgba(161,170,183,.5);
  }
}



/* inside page title (sry had to use this crazy class selector) */
[data-block-internal-id="core_slider_regular"] .page-top__static-caption {
  top: auto;
  bottom: 10%!important;
  transform: translate(-50%, 0)!important;
  -webkit-transform: translate(-50%, 0)!important;
}

@media (min-width: 641px) {
  [data-block-internal-id="core_slider_regular"] h1 {
    font-size: 2.5rem;
  }  
} 


.contact-message-contact-form .button {
	background-color: var(--secondary-color,--primary-color)!important;
}
 
#block-disclaimerblock p:last-of-type {
	margin-bottom: 0;
}

/* disclaimer wrong container fix*/
#block-disclaimerblock .grid-container-10 {
	max-width: 85.71429rem;
	margin: 0 auto;	
}

.bottom-bar {
	padding-top: 30px;
}


.iframeWrapper {
  position:relative;
  padding-bottom: 56.25%;
  padding-top: 35px;
  height: 0;
  overflow: hidden;
}
.iframeWrapper iframe {
  position: absolute;
  top:0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 1024px) and (min-width: 640px) {
  .navbar-menu-hamburger {
    padding-right: 15px;
  }
}

@media (max-width: 1024px) {
  .is-drilldown {
    min-height: auto!important;
  }
  [data-block-internal-id="aw_core_visitormainmenu"] [data-responsive-menu].drilldown.menu a {
    color: white!important;
  }
  .aw-header__header-top .grid-container {
    padding: 0;
    overflow: hidden;
  }
}


@media (max-width: 640px) {
  .aw-content .grid-container {
    padding-left: 0;
    padding-right: 0;
  }  
  .page--node-type-products-services .products-services .media-object-section {
    margin: 0;
  }
  .path-products-services .products-services.media-object {
    flex-direction: column;
    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
  }
  .path-products-services .products-services .media-object-section {
    margin: 0;
  }
}

@media (min-width: 768px) {
  .blog--full .field--name-field-featured-image {
    float: right;
    width: 500px;
    margin-left: 15px;
  }
}

@media screen and (min-width: 640px) {
  [data-block-internal-id="core_slider_regular"] h1,
  [data-block-internal-id="core_slider_regular"] .page-top__static-caption h1 {
    text-transform: none;
    font-size: 1.5rem;
  }
}
    

@media screen and (max-width: 500px) {
  [data-block-internal-id="core_slider_regular"] .page-top__static-caption h1 {
    text-overflow: unset;
    overflow: visible;
    white-space: normal;
    font-size: 1.35rem;
    text-transform: none!important;
  }  
}

// js

<script>
jQuery(".navbar-menu-block > div.width-100 > div.cell").removeClass("show-for-medium");
jQuery(".logo-section").removeClass("large-2").addClass("large-3");
//fix team page
jQuery(".path-team-member-01 .team-member").unwrap();
jQuery( ".path-team-member-01 .team-member" ).wrapAll( "<div class='grid-x medium-up-2 large-up-4 grid-margin-x' />");
jQuery('.page--node-type--team-member-01 .team-member__headshot').removeClass('medium-4').addClass('large-2 medium-3');


jQuery(".path-products-services .products-services").unwrap();
	jQuery( ".path-products-services .products-services" ).wrapAll( "<div class='grid-x medium-up-2 grid-padding-x' />");
</script>

text css网格

Links del curso https://www.youtube.com/playlist?list=PLM-Y_YQmMEqBxmylkI5WJn9ouUxWlJNOW

css-grid-links
https://caniuse.com/#search=grid
https://css-tricks.com/snippets/css/complete-guide-grid/
http://slides.com/juanandresnunez/css-grid-lo-que-debes-saber#/3

text 本地git存储库的post-commit

本地git存储库的post-commit

post-commit.sample
#!/bin/bash
/usr/bin/curl http://localhost:8080/git/notifyCommit?url=file:///Users/dre09/Workspace/git-bskyb-com/bms

text Virtualhost管理脚本

https://github.com/RoverWire/virtualhost

create
sudo virtualhost create anothersite.dev my_dir

text 用于远程部署的post-commit git示例

用于远程部署的post-commit git示例

post-commit.sample
#!/bin/bash

#ref:https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks

while read oldrev newrev ref
do
    if [[ $ref =~ .*/master$ ]];
    then
        echo "Master ref received.  Deploying master branch to production..."
        git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f
    else
        echo "Ref $ref successfully received.  Doing nothing: only the master branch may be deployed on this server."
    fi
done

text nginx的-SSL-反向proxy.conf.txt

nginx-ssl-reverse-proxy.conf.txt
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration


upstream nextcloud{
    server localhost:10080;
}

server {
	listen 80 default_server;
	listen [::]:80 default_server;

	# SSL configuration
	#
	listen 443 ssl default_server;
	listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;
    include snippets/ssl-tornets.com.conf;
    include snippets/ssl-params.conf;

	root /var/www/html;

	# Add index.php to the list if you are using PHP
	index index.html index.htm index.nginx-debian.html;

	server_name tornets.com;

    location / {
		proxy_pass	http://nextcloud/;
		proxy_set_header   Host              $host:10443;
		proxy_set_header   X-Real-IP         $remote_addr;
		proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
		proxy_set_header   X-Forwarded-Proto https;
		proxy_set_header   X-Scheme          $scheme;

		proxy_connect_timeout 600;
		proxy_read_timeout 600;
		proxy_send_timeout 600;

		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";

    }

	# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
	#
	#location ~ \.php$ {
	#	include snippets/fastcgi-php.conf;
	#
	#	# With php7.0-cgi alone:
	#	fastcgi_pass 127.0.0.1:9000;
	#	# With php7.0-fpm:
	#	fastcgi_pass unix:/run/php/php7.0-fpm.sock;
	#}

	# deny access to .htaccess files, if Apache's document root
	# concurs with nginx's one
	#
	#location ~ /\.ht {
	#	deny all;
	#}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#	listen 80;
#	listen [::]:80;
#
#	server_name example.com;
#
#	root /var/www/example.com;
#	index index.html;
#
#	location / {
#		try_files $uri $uri/ =404;
#	}
#}

text cancelsTouchesInView

cancelsTouchesInView
/// https://stackoverflow.com/questions/40365971/how-to-add-tap-gesture-to-uicollectionview-while-maintaining-cell-selection
let tapGesture = UITapGestureRecognizer.init(target: self, action: #selector(tapAction))
tapGesture.cancelsTouchesInView = false
self.messagesCollectionView.isUserInteractionEnabled = true
self.messagesCollectionView.addGestureRecognizer(tapGesture)

text 集合排序列表

集合排序列表

Collection sorting List
 public static List<Employee> getEmployeeListSortedByName() {
        
        
        final List<Employee> employeeList = getEmployeeList();

        Collections.sort(employeeList, new Comparator<Employee>() {
            @Override
            public int compare(Employee a1, Employee a2) {
                return a1.getName().compareTo(a2.getName());
            }
        });

        return employeeList;
    }

text Vagrantfile

Vagrantfile

Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

BOX_NAME = ENV['BOX_NAME'] || "centos/7"
VAGRANTFILE_API_VERSION = "2"

CONSUL_ENCRYPT = "eEZJ2MTe0keJc2EkvZ+l3Q=="
CONSUL_DATACENTER = "nyc"
CONSUL_DATA_DIR = "/var/consul"
CONSUL_NODE_IP = {
  node1: "172.20.20.2",
  node2: "172.20.20.3",
  node3: "172.20.20.4",
  node4: "172.20.20.5",
  node5: "172.20.20.6",
}
CONSUL_NODE_HOSTS = <<HOSTS
172.20.20.2 node1
172.20.20.3 node2
172.20.20.4 node3
172.20.20.5 node4
172.20.20.6 node5
HOSTS

def consul_config(bind_addr, bootstrap = false, server = false, ui = false)
  config =<<-EOF
{
    "bootstrap":            #{bootstrap},
    "server":               #{server},
    "ui":                   #{ui},
    "datacenter":           "#{CONSUL_DATACENTER}",
    "data_dir":             "#{CONSUL_DATA_DIR}",
    "encrypt":              "#{CONSUL_ENCRYPT}",
    "log_level":            "INFO",
    "enable_syslog":        true,
    "enable_script_checks": true,
    "bind_addr":            "#{bind_addr}",
    "client_addr":          "0.0.0.0"
}
  EOF
  config
end

$init_script = <<SCRIPT
echo "Installing Consul ..."
if [ -f /vagrant/consul_0.9.0_linux_amd64 ]; then
  echo "Find consul"
  cp /vagrant/consul_0.9.0_linux_amd64 /tmp/consul
else
  echo "Can not find Consul"
  exit 1
fi

if [ -f /vagrant/consul-manager.sh ]; then
  echo "Find Consul Manager"
  cp /vagrant/consul-manager.sh /usr/bin/consul-manager
else
  echo "Can not find Consul Manager"
  exit 1
fi

sudo chmod a+rwx /usr/bin/consul-manager

cd /tmp
sudo chmod +x consul
sudo mv consul /usr/bin/consul

echo "Configuring consul"
sudo mkdir /etc/consul.d
sudo chmod a+w /etc/consul.d
sudo mkdir /var/consul
sudo adduser consul
sudo chown -R consul:consul /etc/consul.d
sudo chown -R consul:consul /var/consul

echo "Add Hosts"
echo "#{CONSUL_NODE_HOSTS}" >> /etc/hosts
SCRIPT

$script_node1 = <<SCRIPT
sudo su consul
echo '#{consul_config(CONSUL_NODE_IP[:node1], true, true, true)}' \
> /etc/consul.d/config.json
sudo consul-manager start
SCRIPT

$script_node2 = <<SCRIPT
sudo su consul
echo '#{consul_config(CONSUL_NODE_IP[:node2], false, true)}' \
> /etc/consul.d/config.json
sudo consul-manager start
SCRIPT

$script_node3 = <<SCRIPT
sudo su consul
echo '#{consul_config(CONSUL_NODE_IP[:node3], false, true)}' \
> /etc/consul.d/config.json
sudo consul-manager start
SCRIPT

$script_node4 = <<SCRIPT
sudo su consul
echo '#{consul_config(CONSUL_NODE_IP[:node4])}' \
> /etc/consul.d/config.json
sudo consul-manager start
SCRIPT

$script_node5 = <<SCRIPT
sudo su consul
echo '#{consul_config(CONSUL_NODE_IP[:node5])}' \
> /etc/consul.d/config.json
sudo consul-manager start
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = BOX_NAME
  config.vm.provision "shell", inline: $init_script

  config.vm.define "node1" do |n|
    n.vm.provision "shell", inline: $script_node1
    n.vm.hostname = "node1"
    n.vm.network "private_network", ip: CONSUL_NODE_IP[:node1]
    n.vm.network "forwarded_port", guest: 8500, host: 8500, protocol: "tcp"
  end

  config.vm.define "node2" do |n|
    n.vm.provision "shell", inline: $script_node2
    n.vm.hostname = "node2"
    n.vm.network "private_network", ip: CONSUL_NODE_IP[:node2]
  end

  config.vm.define "node3" do |n|
    n.vm.provision "shell", inline: $script_node3
    n.vm.hostname = "node3"
    n.vm.network "private_network", ip: CONSUL_NODE_IP[:node3]
  end

  config.vm.define "node4" do |n|
    n.vm.provision "shell", inline: $script_node4
    n.vm.hostname = "node4"
    n.vm.network "private_network", ip: CONSUL_NODE_IP[:node4]
  end

  config.vm.define "node5" do |n|
    n.vm.provision "shell", inline: $script_node5
    n.vm.hostname = "node5"
    n.vm.network "private_network", ip: CONSUL_NODE_IP[:node5]
  end
end

text GIT从当前分支的主人那里获得最新的更新

test
Option 1
==

commit current branch
git fetch all
git rebase origin/master

Option 2
==

1. commit current-branch
2. git pull --rebase origin master
3. resolve conflict kalau ade

//fetch tu akan update all local remote branch