Skip to content

Instantly share code, notes, and snippets.

View sofish's full-sized avatar
🚀
still hiring creatives

小鱼 sofish

🚀
still hiring creatives
View GitHub Profile
#!/bin/bash
echo 'start...'
git lfs install
git clone https://huggingface.co/coreml/coreml-lofi-V2
git clone https://huggingface.co/coreml/coreml-realisticVision-v20
git clone https://huggingface.co/coreml/coreml-floralPatterns-v10
git clone https://huggingface.co/coreml/coreml-vanGoghDiffusion_v1
git clone https://huggingface.co/coreml/coreml-Project-AIO
@sofish
sofish / textStorage.js
Created September 16, 2011 03:13
Cross-browser TextStorage Solution
/**
* @ NAME: Cross-browser TextStorage
* @ DESC: text storage solution for your pages
* @ COPY: sofish, http://sofish.de
*/
typeof window.localStorage == 'undefined' && ~function () {
var localStorage = window.localStorage = {},
prefix = 'data-userdata',
doc = document,
@sofish
sofish / urlparser.js
Last active March 18, 2021 11:31
URL Parser
var parser = function(url) {
var a = document.createElement('a');
a.href = url;
var search = function(search) {
if(!search) return {};
var ret = {};
search = search.slice(1).split('&');
for(var i = 0, arr; i < search.length; i++) {
@sofish
sofish / random.js
Created January 27, 2021 02:55
random.js
const os = require('os');
module.exports = function random() {
return +(process.hrtime()[1] * os.freemem() % 1000 / 1000).toFixed(2);
}
@sofish
sofish / tupleStringToTable.lua
Created August 24, 2020 06:15
read str and parse it as table
function s2t(str)
local t = {}
local l = string.len(str)
local key = ''
local val = ''
local oe = 0
for i = 1, l do
local s = string.sub(str, i, i)
if s ~= ' ' then
@sofish
sofish / 0.3.js
Created April 29, 2020 09:11
0.1 + 0.2 = 0.3
function big(n, m) {
var a1 = f(n), a2 = f(m);
var overflow = d(a1[1], a2[1]);
arr = [a1[0] + a2[0] + overflow[0], overflow[1]];
return +arr.join('.');
}
function f(n) {
var tmp = ('' + n).split('.');
if(tmp.length === 1) tmp[1] = '0';
@sofish
sofish / first.js
Created August 31, 2012 05:47
面试的时候我会经常问,js 中如何获得 <ul> 下的第一个 <li>,你的答案是什么?
// 大家写在评论中吧,代码高亮可以这样写:
// ```js
// your code
// ```
// update: Fri Aug 31 08:39:21
// copyright: https://gist.github.com/3549352
// 加个性能测试:http://jsperf.com/get-dom-s-first-element
var util = {};
@sofish
sofish / array_unique.js
Last active July 11, 2017 01:36
Array Unique
function unique_keys(array) {
var values = {};
for(var i = 0; i < array.length; i++) {
values[array[i]] = null;
}
return Object.keys(values);
}
@sofish
sofish / invert.js
Created June 11, 2015 05:43
invert binary tree
function invert(tree) {
if (!tree instanceof Array || tree.length === 1) return tree;
var ret = [];
var inverted = tree.reverse();
for(var cur in inverted) {
if(!inverted.hasOwnProperty(cur)) continue;
ret.push(inverted[cur] instanceof Array ? invert(inverted[cur]) : inverted[cur]);
}

首先要搞清楚“空两格”的意义是什么?段首空格表示段落重新开始,基本小学写作文都这么教的。但“空两格”真的就能清楚标示段落么?这个问题被放大到互联网上,尤其在对比英文段落效果后,中文段落“空两格”的传统开始受到质疑。先来看新浪博客网志页的两格例子:

1. 无空格无换行排版(下图)

无空格无换行排版

2. 有空格无换行排版(下图)

有空格无换行排版