Skip to content

Instantly share code, notes, and snippets.

View birdgg's full-sized avatar
🎯
Focusing

Birdgg birdgg

🎯
Focusing
View GitHub Profile
@birdgg
birdgg / 1.js
Last active April 19, 2023 07:18
convert fullWithString
const fullWidthToHalfWidth = (str) =>
str.replace(/[\uff01-\uff5e]/g, (ch) =>
String.fromCharCode(ch.charCodeAt(0) - 0xfee0)
);
NSURL *url = [NSURL URLWithString:
@"http://www.onevcat.com/2011/11/debug/;param?p=307#more-307"];
NSLog(@“Scheme: %@”, [url scheme]);
NSLog(@“Host: %@”, [url host]);
NSLog(@“Port: %@”, [url port]);
NSLog(@“Path: %@”, [url path]);
NSLog(@“Relative path: %@”, [url relativePath]);
NSLog(@“Path components as array: %@”, [url pathComponents]);
NSLog(@“Parameter string: %@”, [url parameterString]);
NSLog(@“Query: %@”, [url query]);
@birdgg
birdgg / update.js
Last active December 16, 2015 11:39
read line by line and update
'use strict'
var MongoClient = require('mongodb').MongoClient
var readline = require('readline')
var fs = require('fs')
let url = 'mongodb://xxxxxx'
MongoClient.connect(url)
.then(db => {