Skip to content

Instantly share code, notes, and snippets.

View lampo1024's full-sized avatar
🎯
Focusing

Rector lampo1024

🎯
Focusing
View GitHub Profile
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
T3ZWQ-P2738-3FJWS-YE7HT-6NA3K
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
65Z2L-P36BY-YWJYC-TMJZL-YDZ2S
SFZHH-2Y246-Z483L-EU92B-LNYUA
GSZVS-5W4WA-T9F2E-L3XUX-68473
FTZ8A-R3CP8-AVHYW-KKRMQ-SYDLS
Q3ZWN-QWLZG-32G22-SCJXZ-9B5S4
DAZPH-G39D3-R4QY7-9PVAY-VQ6BU
KLZ5G-X37YY-65ZYN-EUSV7-WPPBS
@lampo1024
lampo1024 / 10-convert-pfx.sh
Created April 11, 2022 01:41 — forked from jamerst/10-convert-pfx.sh
LetsEncrypt auto-renewal scripts for ASP.NET 5/Core apps in Docker
certsDir="/certs"
dateString=$(date +%s)
mv "$certsDir/cert.pfx" "$certsDir/old/cert-$dateString"
openssl pkcs12 -export -out "$certsDir/cert.pfx" -inkey "$RENEWED_LINEAGE/privkey.pem" -in "$RENEWED_LINEAGE/cert.pem" -password pass:CERT_PASSWORD
@lampo1024
lampo1024 / OracleDynamicParameters.cs
Created December 14, 2021 08:11 — forked from koxkox/OracleDynamicParameters.cs
OracleDynamicParameters class for Dapper
using Dapper;
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters
{
private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>();
@lampo1024
lampo1024 / adonet-demo-script.sql
Created September 27, 2021 08:08
C#+ADO.NET读取MSSQL Server数据库中的数据(示例SQL脚本)
CREATE TABLE Customer (
Id INT IDENTITY(1,1) PRIMARY KEY,
FamilyName NVARCHAR(50),
GivenName NVARCHAR(50),
Email NVARCHAR(50),
Gender NVARCHAR(10),
IpAddress NVARCHAR(20),
CreatedAt DATETIME
);
INSERT INTO Customer (FamilyName, GivenName, Email, Gender, IpAddress, CreatedAt) VALUES ('秋', '香茹', 'mmowsdell0@acquirethisname.com', '男', '31.253.158.172', '2019-05-18 00:50:03');
@lampo1024
lampo1024 / Startup.cs
Created September 6, 2021 01:25 — forked from HelBorn/Startup.cs
Adding a program to startup in C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
namespace RunOnStartup
{
/// <summary>
/// It attempts to write to HKEY_LOCAL_MACHINE first, which will run on startup on all user accounts.
angular.module('services')
.config(function($httpProvider){
//Here we're adding our interceptor.
$httpProvider.responseInterceptors.push('globalInterceptor');
})
//Here we define our interceptor
.factory('globalInterceptor', function($q){
//When the interceptor runs, it is passed a promise object
return function(promise){
@lampo1024
lampo1024 / index.html
Created September 5, 2019 07:25 — forked from zross/index.html
Animate path on Leaflet map using D3 (Gimme!, Proletariat)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' />
@lampo1024
lampo1024 / vs-code-user-settings.json
Created December 18, 2018 08:18
VS Code用户自定义配置
{
"workbench.colorTheme": "Visual Studio Light",
"editor.wordWrap": "on",
"breadcrumbs.enabled": true,
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"workbench.startupEditor": "welcomePage",
"files.insertFinalNewline": true,
"editor.minimap.showSlider": "always",
@lampo1024
lampo1024 / LuceneService.cs
Created November 2, 2018 07:11 — forked from dsuarezv/LuceneService.cs
Lucene.net 4.8 beta basic indexing and search
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Core;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.QueryParser.Classic;
using Lucene.Net.Search;
using Lucene.Net.Store;
using System;
using System.Collections.Generic;
using System.Linq;
@lampo1024
lampo1024 / BackupWithSmo.cs
Created October 23, 2018 05:41
Using SMO for Backup, Restore and Security Purposes
//https://www.codeproject.com/Articles/14848/Using-SMO-for-Backup-Restore-and-Security-Purposes
private static Server GetServer()
{
ServerConnection conn = new ServerConnection(serverName, userName, password);
Server myServer = new Server(conn);
return myServer;
}
static void BackupDataBase(string databaseName, string destinationPath)
{