This file contains 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
import java.util.Random; | |
public class Main { | |
public static void main(String[] args) { | |
long start = System.currentTimeMillis(); | |
Random r = new Random(); | |
for (int i = 0; i < 1000; i++) { | |
for (int j = 0; j < 1000; j++) { | |
if (r.nextInt(4) == 0) { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# overwrite master with contents of seotweaks branch (seotweaks > master) | |
git checkout seotweaks # source name | |
git merge -s ours master # target name | |
git checkout master # target name | |
git merge seotweaks # source name |
This file contains 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/sh | |
BRANCH=$1 | |
git merge --no-commit --no-ff $1; git status; git merge --abort | |
# References: https://stackoverflow.com/questions/501407/is-there-a-git-merge-dry-run-option |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodePen - A Pen by Mu Chun Wang</title> | |
<link rel='stylesheet prefetch' href='https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.css'> | |
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> | |
<script src='https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js'></script> | |
</head> |
This file contains 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
$(function(){ | |
var queryDict = {}; | |
location.search.substr(1).split("&").forEach(function(item) {queryDict[item.split("=")[0]] = item.split("=")[1]}); // 取得網址列的參數 | |
$(".nav>ul>li:has(ul)>a").after('<a href="#" class="menu-plus">+</a>'); // 判斷第一層裡面是否還有選單,有的話就加上 <a href="#" class="menu-plus">+</a> | |
$(".nav>ul>li>ul>li:has(ul)>a").after('<a href="#" class="menu-plus">+</a>'); // 判斷第二層裡面是否還有選單,有的話就加上 <a href="#" class="menu-plus">+</a> | |
$(".nav>#nav-btn").click(function() { // 當點選 #nav-btn 時,就開關第一層的 menu |
This file contains 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
$(function(){ | |
$(".hide-form-title").click(function(){ // 點選 title 的時候 | |
$(this).siblings(".hide-form").slideToggle(function(){ // 找出同一層的 hide-form,然後開關 | |
var img = $(this).siblings(".hide-form-title").find("img"); // 然後再找回原來 title 裡面的 img | |
var src = img.attr("src"); // 把 src 找出來 | |
if (src === "images/down-arrow.png") { // 做上下箭頭的切換 | |
img.attr("src", "images/up-arrow.png"); | |
} else { | |
img.attr("src", "images/down-arrow.png"); |
This file contains 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
/*price range*/ | |
$('#sl2').slider(); | |
var RGBChange = function() { | |
$('#RGB').css('background', 'rgb('+r.getValue()+','+g.getValue()+','+b.getValue()+')') | |
}; | |
/*scroll to top*/ |
This file contains 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
<div class="container"> | |
<div class="row"> | |
<div class="col-sm-3"> | |
<div class="left-sidebar"> | |
<h2>Product Categories</h2> | |
<div class="panel-group category-products" id="accordian"><!--category-productsr--> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h4 class="panel-title"> | |
<a data-toggle="collapse" data-parent="#accordian" href="#sportswear"> |