Skip to content

Instantly share code, notes, and snippets.

View imanabu's full-sized avatar

Manabu Tokunaga imanabu

View GitHub Profile
@imanabu
imanabu / NLOG app.config AutoRotate7 Days
Last active September 25, 2023 02:51
NLog Configuration That Auto-Rotate with Config Section
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="console" xsi:type="Console" layout="${longdate} ${callsite} ${level} ${message}"/>
<target name="logfile" xsi:type="File" fileName="C:\temp\log.txt" layout="${longdate} ${callsite} ${level} ${message}"/>
<target name="rotatelog" xsi:type="File"
layout="${longdate} ${logger} ${message}"
fileName="c:/temp/logs/alogfile.txt"
@imanabu
imanabu / ConnectionStrings.config
Last active August 29, 2015 14:11
Visual Studio Snips
<connectionStrings>
<add name="myConnectionString" connectionString="Data Source=HOST\INSTANCE;Initial Catalog=myDB;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
@imanabu
imanabu / Python SHA Hash File
Last active August 29, 2015 14:15
Python Gist
import hashlib
def hashfile(afile, hasher, blocksize=65536):
buf = afile.read(blocksize)
while len(buf) > 0:
hasher.update(buf)
buf = afile.read(blocksize)
return hasher.digest()
[(fname, hashfile(open(fname, 'rb'), hashlib.sha256())) for fname in fnamelst]
@imanabu
imanabu / cflags.sh
Last active August 29, 2015 14:17
MacOS: Show ~/Library on Open Dialog Bix
chflags nohidden ~/Library
@imanabu
imanabu / start-storescp.bat
Created March 16, 2015 20:55
DCMTK Commands I Use
REM Run DCMTK StoreSCP in promisucus mode
storescp -pm -od c:\temp 104
@imanabu
imanabu / MacThreadDump.md
Last active August 9, 2019 22:17
MacOS Taking App Thread Dump from Terminal
  1. Browse to the /Applications/.app/Contents/MacOS/ executable in Finder,
  2. In the context menu choose Open With, Terminal.
  3. To get a thread dump press Ctrl+\ in the Terminal window.
@imanabu
imanabu / IgnoreForeignKeyConstriants.sql
Last active August 9, 2019 22:22
mySQL Ignore Foreign Key Constraint Checks When Deleting
use somedb;
SET FOREIGN_KEY_CHECKS=0;
delete from account where firstname='8';
select id, email, firstname, lastname from account;
@imanabu
imanabu / tsconfig.json
Created August 16, 2015 14:25
Angularjs 2.0 TypeScript Configurations tsconfig.json
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false
@imanabu
imanabu / python3-http-server-8000.sh
Created August 16, 2015 14:30
Angularjs 2.0 Starting a Test SimpleHTTPServer with Python 3
#!/bin/sh
# python3 -m http.server --help
python3 -m http.server 8000
@imanabu
imanabu / WebStormAngularJS2TypescriptCommandLineOptions.txt
Created August 18, 2015 03:10
WebStorm AngularJS2 Typescript Command Line Options
--watch -m commonjs -t es5 --emitDecoratorMetadata --experimentalDecorators