Skip to content

Instantly share code, notes, and snippets.

View ichengzi's full-sized avatar
🥇
coding...

chengzi ichengzi

🥇
coding...
View GitHub Profile
@ichengzi
ichengzi / stata.md
Last active August 22, 2023 06:33
stata分析

一、简单操作

下载外部命令:ssc install outreg2 logout pwcorr_a

二、描述性统计

outreg2 using xxx.doc, replace sum(log) title(Decriptive statistics)
outreg2 using xxx.doc, replace sum(log) keep(**v** **v** **v**) title(Decriptive statistics)
outreg2 using xxx.doc, replace sum(log) keep(**v** **v** **v**) eqkeep(N mean min max) title(Decriptive statistics)
bysort x:outreg2 using xxx.doc, replace sum(log) title(Decriptive statistics)
import React from 'react';
import ReactDOM from 'react-dom';
class AppComponent extends React.Component {
state = {
numChildren: 0
}
render () {
@ichengzi
ichengzi / test.md
Created March 31, 2023 06:01
test linux sleep

test.c

#include <unistd.h>
void main() {
  sleep(5);
}
  1. gcc test.c -o test.out
  2. strace ./test.out
@ichengzi
ichengzi / log.md
Last active July 18, 2023 01:30
idea 日志 live template. 快速打印日志,入参,返回,异常

来源: 【我把老婆(冰冰)放到了Idea 里!这是一个正经视频,后面还讲了代码快速补全,live template 打日志。】 【精准空降到 05:46】 https://www.bilibili.com/video/BV1uR4y1p7Lh/?share_source=copy_web&vd_source=af63ea840971731c498a30c3de502821&t=346

loge
log.error($content$,$params$);
content 参数:
groovyScript("def params = _2.collect {'【'+it+' = {}】'}.join(', '); return '\"[[title='+_1+']] ' + _1 + '() called with exception => ' + (params.empty  ? '' : params) + '\"'", methodName(), methodParameters())
params参数:
groovyScript("def params = _1.collect {it}.join(', '); return   (params.empty  ? '' : params) + ',e' ",  methodParameters())
@ichengzi
ichengzi / MimeType.cs
Created September 18, 2022 06:25
c# simple http server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace demo
{
public class MimeType
{
public static string GetOrDefault(string fileExtension, string defaultMime)
@ichengzi
ichengzi / RandomIDCardGenerator.cs
Created July 20, 2022 09:36
c# 随机身份证生成器
public class RandomIdCardUtil
{
[Test]
public void generate()
{
for (int i = 0; i < 100; i++)
{
var cusId = RandomIDCardGenerator.GetRandomCard(14, 14);
Console.WriteLine($"{cusId.Substring(0, 6)}" +
$"-{cusId.Substring(6, 4)}" +
@ichengzi
ichengzi / Base64Url.cs
Created July 19, 2022 12:08 — forked from igorushko/Base64Url.cs
Base64Url C#
public static class Base64Url
{
public static string Encode(byte[] arg)
{
if (arg == null)
{
throw new ArgumentNullException("arg");
}
var s = Convert.ToBase64String(arg);
// https://www.bilibili.com/video/BV1BL411K7Dy
const arr = [
[1, 2, 2],
[3, 4, 5, 5],
[6, 7, 8, 9,
[11, 12,
[12, 12,
[13]
]
@ichengzi
ichengzi / menu.css
Last active June 4, 2022 05:10
目录树 html5 detail + summay
/* https://www.bilibili.com/video/BV1mA4y1Z7cy */
/* https://m.php.cn/article/473454.html 画三角形文章 */
details {
position: relative;
width: 300px;
padding-left: 20px;
}
summary {
@ichengzi
ichengzi / flatObj.js
Last active June 4, 2022 04:27
flat deep js object
// https://gist.github.com/ichengzi/fa90fede6c7ce91bbb083ea2e5466a38
const entry = {
a: {
b: {
c: {
dd: "abcdd"
}
},
d: {