Skip to content

Instantly share code, notes, and snippets.

View YiqinZhao's full-sized avatar
🎯
Focusing

Yiqin Zhao YiqinZhao

🎯
Focusing
View GitHub Profile
@YiqinZhao
YiqinZhao / index.js
Created March 9, 2018 07:03
[Vue Reactive Data] How to implement a Vue styled reactive data.
// 元数据
let a = {
source: { number: 0 }
}
// 核心:Object.defineProperty
Object.defineProperty(a, 'number', {
enumerable: true,
configurable: true,
get: function () {
@YiqinZhao
YiqinZhao / question-1.js
Last active June 20, 2019 13:38
[yuanfudao-interview] 猿辅导前端面试总结 #interview
let N = 10
let source = []
let M = 4
for (let i = 0; i < N; i++) {
let len = Math.floor(Math.random() * 5) + 5
let item = []
for (let j = 0; j < len; j++) item.push(Math.floor(Math.random() * 10))
source.push(item)
@YiqinZhao
YiqinZhao / love.c
Created February 22, 2018 14:40
Generate a love shape
#include <stdio.h>
int main() {
for (float y = 1.5f; y > -1.5f; y -= 0.1f) {
for (float x = -1.5f; x < 1.5f; x += 0.07f) {
float a = x * x + y * y - 1;
putchar(' ');
putchar(a * a * a - x * x * y * y * y <= 0.0f ? '*' : ' ');
}
putchar('\n');
@YiqinZhao
YiqinZhao / 8Queens.cpp
Last active April 6, 2019 06:39
8Queens in 10 Lines of C++
#include <iostream>
const int N = 8;
int queen[N];
bool check(int n) {
for (int i = 0; i < n; i++) {
int x = n - i;
int y = queen[n] - queen[i];
@YiqinZhao
YiqinZhao / macOS-Restoring-Tool.sh
Created December 31, 2017 01:18
macOS restoring tool.
#!/bin/zsh
echo "========================================"
echo " macOS restoring script"
echo " Copyright Hawkins Zhao 2017"
echo "========================================"
echo "---> Restoring Applications..."
cp ./Apps/* /Applications/
@YiqinZhao
YiqinZhao / tags.html
Created December 31, 2017 01:16
Useful tags in <head>
<html>
<heda>
<!-- Scratch view for full screen mode in iOS web app -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no, viewport-fit=cover">
<!-- WebApp setup -->
<!-- black-translucent: No background for statebar -->
<!-- black: Black background for statebar -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />