Element -- selects all h2
elements on the page
h2 {
foo: bar;
// Basic Types | |
let id: number = 5 | |
let company: string = 'Traversy Media' | |
let isPublished: boolean = true | |
let x: any = 'Hello' | |
let ids: number[] = [1, 2, 3, 4, 5] | |
let arr: any[] = [1, true, 'Hello'] | |
// Tuple |
import pipeline, { Middleware } from './pipeline'; | |
const step1: Middleware<any, any> = (req, res, next) => { | |
if (req.body) { | |
console.log(`STEP 1: \n req: ${JSON.stringify(req)}\n res: ${JSON.stringify(res)}`); | |
next(); | |
} | |
} | |
const step2: Middleware<any, any> = async (req, res, next) => { |
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '" | |
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
if( $found ){ | |
$remoteport = $matches[0]; | |
} else{ | |
echo "The Script Exited, the ip address of WSL 2 cannot be found"; | |
exit; | |
} |
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/test'); | |
var db = mongoose.connection; | |
db.on('error', function() { | |
return console.error.bind(console, 'connection error: '); | |
}); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var ObjectId = mongoose.Types.ObjectId; | |
console.log('Running mongoose version %s', mongoose.version); | |
var UserSchema = new Schema({ | |
name : String, | |
posts : [{ | |
type : Schema.Types.ObjectId, |
# Chinese (China) translations for Devise(4.2.0) | |
# by HealthGrid (https://github.com/HealthGrid) | |
zh-CN: | |
devise: | |
confirmations: | |
confirmed: "您的帐号已经确认,您现在已登录。" | |
send_instructions: "几分钟后,您将收到确认帐号的电子邮件。" | |
send_paranoid_instructions: "如果您的邮箱存在于我们的数据库中,您将收到一封确认账号的邮件。" | |
failure: |