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
/* | |
* example: @include background@2x( 'path/to/image', 'png', repeat-x); | |
*/ | |
@mixin background_2x($path, $ext: "png", $repeat: no-repeat) { | |
$at1x_path: "#{$path}.#{$ext}"; | |
$at2x_path: "#{$path}@2x.#{$ext}"; | |
background-image: url("#{$at1x_path}"); | |
background-repeat: $repeat; |
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
from bs4 import BeautifulSoup | |
import requests | |
import requests_cache | |
requests_cache.install_cache('nobel_pages', backend='sqlite', expire_after=7200) | |
BASE_URL = 'http://en.wikipedia.org' | |
HEADERS = {'User-Agent': 'Mozilla/5.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
var gulp = require('gulp'); | |
var watch = require('gulp-watch'); | |
var webpackStream = require('webpack-stream'); | |
var batch = require('gulp-batch'); | |
var compass = require('gulp-compass'); | |
var plumber = require('gulp-plumber'); | |
var clean = require('gulp-clean'); | |
var webpackConfig = require('./webpack.config.js'); | |
var browserSync = require('browser-sync'); |
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
var path = require('path'); | |
var webpack = require('webpack'); | |
module.exports = { | |
// if you need browsery sync, you should set it to be true. | |
watch: true, | |
entry: { | |
vendor: [ | |
'./resources/assets/js/vendors/jquery.min.js', | |
'./resources/assets/js/vendors/bootstrap.min.js', |
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
@font-face { | |
font-family: 'Roboto'; | |
font-style: normal; | |
font-weight: 100; | |
src: local('Roboto Thin'), local('Roboto-Thin'), | |
url(fonts/Roboto-Thin.ttf) format('truetype'); | |
} | |
@font-face { | |
font-family: 'Roboto'; | |
font-style: normal; |
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
var Company = function (config) { | |
this.name = config.name; | |
this.fbFansUrl = config.fbFansUrl; | |
}; | |
Company.prototype.getName = function () { | |
return this.name; | |
}; | |
Company.prototype.getFbFansPage = function () { | |
return this.fbFansUrl; | |
}; |
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
/* interfeace 定義對象內部結構 也可以用來約束 class 的行為*/ | |
interface Employee { | |
jobTitle: string, | |
years?: number | |
}; | |
// 此 function 接受 Employee 型別的變數 e | |
function getEmployeeBasicSalary(e: Employee) { | |
// 可能的底薪,亂 key 的 只是示範 XD | |
let basicSalary = e.years * 2; |
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
/* | |
* TypeScript 可以使用 ES6 的 class 語法 | |
* 但 TypeScript 還可以額外使用靜態型別的那種修飾字: | |
* 如 public, protected, private | |
*/ | |
class Employee { | |
// name is public! | |
public name: string; | |
// manager is private, cannot be access from outside |
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
// boolean 布林 | |
var isUserExists = false; | |
// Number 數值 | |
var myAge = 26; | |
// String 字串 | |
var jobTitle = 'Frontend Engineer'; | |
// String 也可以用 字串樣板 (Template Literals) ${ expr } |
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
// boolean 布林 | |
let isUserExists: boolean = false; | |
// Number 數值 | |
let myAge: number = 26; | |
// String 字串 | |
let jobTitle: string = 'Frontend Engineer'; | |
// String 也可以用 字串樣板 (Template Literals) ${ expr } |
NewerOlder