Skip to content

Instantly share code, notes, and snippets.

Avatar
🐥
🐔🐔🥚🥚

medium003 bitfishxyz

🐥
🐔🐔🥚🥚
View GitHub Profile
View form.template.js
<!DOCTYPE html>
<html>
<body>
<form>
Username: <input type="text" name="username" />
Password:<input type="text" name="password" />
Email:<input type="text" name="email" />
View hover.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
font-size: 150px;
}
View v.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<style>
body, button{
font-size: 30px;
}
.red{
color: red;
View v.js
function isNative (Ctor){
return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
}
View v.js
const inBrowser = typeof window !== 'undefined'
const inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform
const weexPlatform = inWeex && WXEnvironment.platform.toLowerCase()
const UA = inBrowser && window.navigator.userAgent.toLowerCase()
const isIE = UA && /msie|trident/.test(UA)
const isIE9 = UA && UA.indexOf('msie 9.0') > 0
const isEdge = UA && UA.indexOf('edge/') > 0
const isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android')
const isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios')
const isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge
View v.js
function countFrequency(arr){
let result = new Map();
for(let element of arr){
if(result.get(element)) {
result.set(element, result.get(element) + 1)
} else {
result.set(element, 1)
}
}
return result;
View programming.js
// Get the price of apples from a fruit store
function getApplePrice(fruitStore) {
'start visiting the fruit store';
'walk to the fruit shop';
if('the fruit store was not open'){
'stop the process of visiting the fruit store';
return false;
}
View programming.js
'the apple purchase process begins';
'Declare a variable `lowestPriceFruitStore`, used to represent the fruit store with the lowest apple prices.';
for(fruitStore of [fruitStroe0, fruitStroe1, fruitStroe2]){
'start visiting the fruit store';
'walk to the fruit shop';
if('the fruit store was not open'){
'stop the process of visiting the fruit store';
}
View programming.js
'the apple purchase process begins';
// try to visit these 3 fruit stores in turn
for(fruitStore of [fruitStroe0, fruitStroe1, fruitStroe2]){
'start visiting the fruit store';
'walk to the fruit shop';
if('the fruit store was not open'){
'stop the process of visiting the fruit store';
}
View promise.js
class MyPromise{
constructor(executor) {
this.status = "pending";
this.value = undefined;
// This array is used to store all the onResolve functions in the chain call
this.resolveArr = [];
// // This array is used to store all the onReject functions in the chain call
this.rejectArr = [];