Skip to content

Instantly share code, notes, and snippets.

@t3hmun
t3hmun / GetNLogLogger.cs
Created September 30, 2013 15:30
Get NLog logger
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
@t3hmun
t3hmun / NLog.config
Created September 30, 2013 15:36
NLog config that outputs 2 log files one for everything (not trace) another for Warn and worse. A log file is create for the current date and appended to every time the program is run.
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="asyncFile" xsi:type="AsyncWrapper">
<target name="logfile" xsi:type="File" fileName="Debug ${shortdate}.log" />
</target>
<target name="asyncFile2" xsi:type="AsyncWrapper">
<target name="warnlog" xsi:type="File" fileName="Warn ${shortdate}.log" />
@t3hmun
t3hmun / disqus.html
Last active August 29, 2015 14:00
A modified version of Disqus's universal code for Jekyll posts.
<div id="disqus_thread"></div>
<script type="text/javascript">
/*
This is the Disqus 'Universal Code' modified to work better with Jekyll.
You don't need edit here, edit your _config.yml an your post front-matter.
*/
var disqus_shortname = '{{ site.dqshortname }}'; // Set this var in your _config.yml
/*
Ideally set disqus_identifier to something unique in the front-matter of each post.
You need this identifier to be unique and unchanging to maintain the discussion thread for that post.
@t3hmun
t3hmun / userDefineLang.xml
Created May 19, 2014 15:24
FSharp F# Zenburn Notepad++. Add this to `%appdata%\Notepad++` or add the `<UserLang...` to your `userDefineLang.xml` if it already exists.
<NotepadPlus>
<UserLang name="F#" ext="fs fsi fsx">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&quot;00&quot;00</Keywords>
<Keywords name="Folder+"></Keywords>
@t3hmun
t3hmun / NLogCurrentClassLogger.cs
Created August 4, 2014 17:33
Nlog current class logger
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
@t3hmun
t3hmun / stackStylish
Created January 29, 2015 16:35
Stack Exchange single column wordwrapping view for stylish. There is some unneccary stuff in here, its all a bit of a hack. But now Stack pages worwrap to browser width nicely, and distractors like hot network question are far off at the bottom of the screen.
@-moz-document domain('stackoverflow.com'), domain('superuser.com'), domain('serverfault.com'), domain('stackapps.com'), domain('stackexchange.com'), domain('askubuntu.com') {
.fw {
width: unset;
}
.topbar .topbar-wrapper {
width:unset;
}
@t3hmun
t3hmun / sqltojava.py
Last active August 29, 2015 14:16
Creates Java Strings for SQLite tables, columns and indexes. Does not repeat duplicate column names.
# -*- coding: utf-8 -*-
"""SQL to Java String generator.
python3
https://gist.github.com/t3hmun
2015/02/23
"""
def sqltojava():
body{
font-size: 24px;
}
.monaco-editor.tfs-extension-default {
font-size: 20px;
line-height: 26px;
}
.monaco-editor.hc-black .monaco-editor-background, .hc-black, .monaco-editor{
@t3hmun
t3hmun / no_code_all_the_libraries.txt
Created May 27, 2019 20:16
Running MSBuild on a csproj that only contains Microsoft.NET.Sdk.Web and TargetFramework netcoreapp2.1, no other files.
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 27/05/2019 21:10:08.
Project "C:\home\cs\AspCoreFromScratch\001_csproj\001_csproj.csproj" on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreGenerateAssemblyInfo:
Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
CoreCompile:
@t3hmun
t3hmun / uptime.ps1
Created October 31, 2022 20:19
Download sysinternals psping.exe to create a log of pings to google every second.
./psping.exe -i 1 -t 8.8.8.8 | Foreach{"{0}, {1}" -f (Get-Date),$_} >> uptime.txt