Skip to content

Instantly share code, notes, and snippets.

View chenyahui's full-sized avatar
🎯
Focusing

cyhone chenyahui

🎯
Focusing
View GitHub Profile
@chenyahui
chenyahui / mime_type_gen.py
Created January 16, 2019 02:47
mime_type_gen.py
import json
def load_from_url():
with open('db.json') as f:
return json.load(f)
def mime_type_to_var(mime_type):
return mime_type.upper().replace("+", "_").replace("/","_").replace("-","_").replace(".","_")
def print_lines(file, lines):
@chenyahui
chenyahui / code_counter.py
Created January 9, 2019 10:26
统计代码行数
# coding=utf-8
import os
basedir = './corn'
whitelist = ['cpp', 'h']
def get_files_in_dir(basedir):
filelists = []
for parent,dirnames,filenames in os.walk(basedir):
for filename in filenames:
@chenyahui
chenyahui / TimedMethod.cs
Created August 8, 2018 09:26
一个通用的C#时耗统计函数
class NetTimeException : Exception
{
public string msg;
public long time;
public NetTimeException(string msg, long time)
{
this.msg = msg;
this.time = time;
}
}
@chenyahui
chenyahui / DateUtils.java
Created November 24, 2017 07:41
页面日期时间抽取
package com.cyhone;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/**
* @author cyhone
* @date 2017/3/28
#pragma once
namespace cyh {
template<class T>
class SmartPtr;
template <typename T>
class U_Ptr;
template <typename T>
class U_Ptr
{
第一步,找到项目文件下的 .csprojc 文件,用文本编辑器打开它,并找到下面这行:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
把下面的 XML 粘贴到文件中,然后保存并在 Visual Studio 中重载:
<Target Name="AfterResolveReferences">
<ItemGroup>
<EmbeddedResource Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Extension)' == '.dll'">
<LogicalName>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>
第一步,找到项目文件下的 .csprojc 文件,用文本编辑器打开它,并找到下面这行:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
把下面的 XML 粘贴到文件中,然后保存并在 Visual Studio 中重载:
<Target Name="AfterResolveReferences">
<ItemGroup>
<EmbeddedResource Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Extension)' == '.dll'">
<LogicalName>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>