Skip to content

Instantly share code, notes, and snippets.

View Codespilot's full-sized avatar

damon Codespilot

View GitHub Profile
@Codespilot
Codespilot / EntityFramework.cs
Created January 28, 2024 15:04 — forked from FabianoCampos/EntityFramework.cs
Row_number over (Partition by yyy) em Entity Framework
_contexto.Tramitacao
.Where(x => entrada.Contains(x.IdDocumento))
.GroupBy(x => new { x.IdDocumento })
.Select(g => g.OrderBy(e=> e.IdDocumento).ThenByDescending(e => e.Data).Take(1))
.SelectMany(e => e.Select(x => new TramitacaoDocumentoModel
{
IdDocumento = x.IdDocumento,
IdStatus = x.IdStatus,
DataTramitacao = x.Data
}));
@Codespilot
Codespilot / ACL4SSR-Helps.md
Created October 23, 2023 05:04 — forked from Teraflopst/ACL4SSR-Helps.md
本文主要是教你怎么定制一下自己的ACL或者clash规则。

1. 前言

本文主要是教你怎么定制一下自己的ACL或者clash规则。

前面稍微科普一下去广告的分类、不作为重点。

本文不能顾及全网的规则,仅做一般普及,需要有点基础,非小白科普文章

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@Codespilot
Codespilot / xamarinandroidbindings.md
Created September 26, 2023 01:39 — forked from JonDouglas/xamarinandroidbindings.md
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@Codespilot
Codespilot / readLocation.js
Created September 26, 2023 01:32 — forked from 1yx/ readLocation.js
read qq location list file in js, special thanks https://www.v2ex.com/t/32786
var parseString = require('xml2js').parseString;
var fs = require('fs');
var _ = require('underscore');
require.extensions['.xml'] = function (module, filename) {
module.exports = fs.readFileSync(filename, 'utf8');
};
var zh = require("./LocList-zh.xml");
var en = require("./LocList-en.xml");
@Codespilot
Codespilot / ChinaDate.class
Created September 14, 2023 14:52 — forked from greatcodeeer/ChinaDate.class
C# 计算农历日期
public static class ChinaDate
{
private static ChineseLunisolarCalendar china = new ChineseLunisolarCalendar();
private static Hashtable gHoliday = new Hashtable();
private static Hashtable nHoliday = new Hashtable();
private static string[] JQ = { "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至" };
private static int[] JQData = { 0, 21208, 43467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758 };
static ChinaDate()
{
@Codespilot
Codespilot / Xamarin.iOS Get Carrier Name
Created February 18, 2023 06:29 — forked from dannycabrera/Xamarin.iOS Get Carrier Name
Xamarin.iOS Get Carrier Name
static string GetCarrierName () { using (var info = new CTTelephonyNetworkInfo ()) { return info.SubscriberCellularProvider.CarrierName; } }
@Codespilot
Codespilot / HttpLoggingHandler.cs
Created October 26, 2022 13:44 — forked from flobaader/HttpLoggingHandler.cs
Log HTTP Requests with Refit
public class HttpLoggingHandler : DelegatingHandler
{
public HttpLoggingHandler(HttpMessageHandler innerHandler = null)
: base(innerHandler ?? new HttpClientHandler())
{
}
async protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{