使用highlight.js或prism.js高亮你的代码
HTML
<div id="list">
<li>1-1</li>
<li>1-2</li>
<li>1-3</li>
</div>
CSS
.list {
list-style: none;
color: aqua;
}
.list li {
text-align: center;
font-size: 14px;
}
SCSS
#main p {
color: #00ff00;
width: 97%;
.redbox {
background-color: #ff0000;
color: #000000;
}
}
JavaScript
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
JSON
{
"name": "ShenBao",
"occupation": "Web App Developer"
}
XML
<note>
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>
Angular
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'Angular CNode';
constructor() {
}
}
TypeScript
let str:string = 'str';
const tml = `${str}`;
let isDone: boolean = false;
let list: number[] = [1, 2, 3];
interface LabelledValue {
label: string;
}
function printLabel(labelledObj: LabelledValue) {
console.log(labelledObj.label);
}
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
let greeter = new Greeter("world");
java
/**
* java HelloWorld
*/
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
ruby
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
bash
#!/bin/sh
sed 's/abc/cba/'
curl
#!/bin/bash
echo "Hello World !"
chmod +x ./test.sh #使脚本具有执行权限
./test.sh #执行脚本
/bin/sh test.sh
diff
##webpack-demo
|- package.json
|- webpack.config.js
|- /dist
|- bundle.js
|- index.html
|- /src
- |- style.css
+ |- style.scss
|- index.js
|- /node_modules
- <title>Getting Started</title>
+ <title>Asset Management</title>
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: [
+ 'style-loader',
+ 'css-loader'
+ ]
+ }
+ ]
+ }
};
let str:string = 'str';
- const tml = str + 'ing';
+ const tml = `${str}ing`;
百行代码测试
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
var str = 'string';
var num = 88;
var bool = true;
var fn = function(){
console.log(str);
}
function hFn(){
alert('test');
}
【 THE END 】
------ ShenBao on January 18, 2018
温馨提示:评论可能需要科学上网,若不能正常显示,敬请谅解!