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
# HTTP - redirect all requests to HTTPS: | |
server { | |
listen 80; | |
server_name notable.wushan.io; | |
return 301 https://$host$request_uri; | |
} | |
# HTTPS - proxy requests on to local Node.js app: | |
server { | |
listen 443; |
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
var limit = 10 | |
var row = [] | |
for (var i = 0; i < limit; i++) { | |
row.length = 0 | |
//Space | |
for (var space = 0; space < (limit - i); space++) { | |
row.push(' ') | |
} | |
for (var stars = 0; stars < i; stars++) { | |
row.push('*') |
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
var canvas = window.canvas | |
// Scale Canvas to fit viewport | |
// var container = document.getElementById('artboard') | |
var container = document.querySelector('.canvas-wrapper') | |
var paintArea = document.getElementById('canvas') | |
// canvas.wrapperEl.style.transform = "scale(.8)" | |
;(function () { | |
// console.log(canvas) | |
// var aspectRatio = canvas.width / canvas.height | |
// Ratio = Canvas 寬(實際px) 與 artboard 寬的比值 |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /your/root/path; | |
index index.html; | |
server_name you.server.com; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<add name="Access-Control-Allow-Origin" value="*" /> | |
<add name="Access-Control-Allow-Methods" value="GET, PUT, POST, DELETE, HEAD, OPTIONS" /> | |
<add name="Access-Control-Allow-Credentials" value="true"/> | |
<add name="Access-Control-Allow-Headers" value="X-Requested-With, origin, content-type, accept" /> | |
</customHeaders> |
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
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="backend" stopProcessing="true"> | |
<match url="^(backend)(.*)$" /> | |
<action type="None" /> | |
</rule> | |
<rule name="Vuejs rules" stopProcessing="true"> | |
<match url="(.*)" /> |
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
//ControlGroup | |
.controlgroup { | |
margin-bottom: .5em; | |
@extend .clear; | |
label { | |
display: block; | |
float: left; | |
line-height: $input-height; | |
width: $label-size; | |
} |
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
// Inspired by http://stackoverflow.com/questions/5106243/how-do-i-get-background-image-size-in-jquery, a simple jquery plugin who does the task | |
$.fn.getBgImage = function(callback) { | |
var height = 0; | |
var path = $(this).css('background-image').replace('url', '').replace('(', '').replace(')', '').replace('"', '').replace('"', ''); | |
var tempImg = $('<img />'); | |
tempImg.hide(); //hide image | |
tempImg.bind('load', callback); | |
$('body').append(tempImg); // add to DOM before </body> | |
tempImg.attr('src', path); |