Skip to content

Instantly share code, notes, and snippets.

View Mpdreamz's full-sized avatar
🐱
😹 😼

Martijn Laarman Mpdreamz

🐱
😹 😼
View GitHub Profile
@Mpdreamz
Mpdreamz / get-endpoints.sh
Created September 15, 2013 16:38
Get all of elasticsearch's REST endpoints, come up with method names for them and dedup them, Used in newer versions of NEST to generate the raw client (if you only need to pass and receive strings from the client. Scroll down for example output
#!/bin/bash
# This scripts scans the elasticsearch source code for all the registered REST endpoints
# It will put the formatted output in $DEFINITIONOUTPUTFILE
# [MethodName] [HttpVerb] [Route]
ESFOLDER="../elasticsearch"
DEFINITIONOUTPUTFILE="src/Generated/rest-actions.txt"
# Find all the lines that registerHandlers
@Mpdreamz
Mpdreamz / gist:997984
Created May 29, 2011 17:39
WPF force software rendering
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
}
}
$ build.cmd
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
Tools are already initialized.
Running: c:\Projects\corefx\src\Native\build-native.cmd x64 Debug Windows_NT --numproc 8 -portable toolSetDir=c:\tools\clr
Tools are already initialized.
Running: c:\Projects\corefx\Tools\msbuild.cmd /nologo /verbosity:minimal /clp:Summary /maxcpucount /nodeReuse:false /l:BinClashLogger,Tools\net46\Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log /p:ConfigurationGroup=Debug /p:BuildPackages=false /p:GenerateNativeVersionInfo=true /flp:v=normal /flp2:warningsonly;logfile=msbuild.wrn /flp3:errorsonly;logfile=msbuild.err c:\Projects\corefx\src\Native\..\../build.proj /t:GenerateVersionHeader
{"_index":"mpdreamz","_type":"blogs","_id":"10", "_source" : {
"id": 10,
"title": "YuwlQyGBD",
"body": "BQFSBpwAflRTUBoBESibOuMvCRnOjgIFjNqEbSsaRdUyOsOUOFcjldwHekqkchrzCLkGLJaLAiJLZoGkCsadDzUFrIArCHykLVVCiHIEfQIdTKHqDFhJGNvDrePdjjjSJzZeSDBvJvynQrmGAKnWaoDXaRLDsFVwhPtuKDxZDmalPiMZRICyVmSvVBeAsyCDZBFAXswWnntNosiRfLmjdxAvxXyIZWHFJwLoCLcZMFlitEhDTmVGLtAcbkDaTnWQFneRguptJmWxmscsQUpNbbTqVJMsicgZIUCFAPXZxCxZWdPIiljzyjPEtNVWhWKhFxORPwRAxpqyDuTsTekWShBzfyMnTASARPTZOySmTIcISrAzTDdCmoOYvpMRJEGwWPGoauDvlydJESgNxntqXPodAUezLbcpBFLdkmzZZHRolfuc",
"author": {
"firstName": "",
"lastName": "Holiman",
"dateOfBirth": "\/Date(-62135596800000+0100)\/",
"id": 0
}
@Mpdreamz
Mpdreamz / gist:4077718
Created November 15, 2012 09:46
Find Locks (SQL SERVER)
SELECT
t1.resource_type,
t1.resource_database_id,
t1.resource_associated_entity_id,
t1.request_mode,
t1.request_session_id,
t2.blocking_session_id,
o1.name 'object name',
o1.type_desc 'object descr',
p1.partition_id 'partition id',
@Mpdreamz
Mpdreamz / max_memory.sql
Created November 28, 2012 14:41
Set maximum memory usage for MSSQL
EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE
GO
EXEC sys.sp_configure N'max server memory (MB)', N'2000'
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE
GO
@Mpdreamz
Mpdreamz / keybase.md
Created November 18, 2016 10:33
keybase.md

Keybase proof

I hereby claim:

  • I am mpdreamz on github.
  • I am mpdreamz (https://keybase.io/mpdreamz) on keybase.
  • I have a public key whose fingerprint is 6EBA 1456 1926 6992 C2B5 163B 819C 04B5 9597 E310

To claim this, I am signing this object:

@Mpdreamz
Mpdreamz / gist:8579620
Created January 23, 2014 14:44
Example of exact term boost over fuzzy for Tomas Jansson
PUT http://localhost:9200/prefix_test
{
"settings": {
"blocks.read_only": false
},
"settings": {
"analysis": {
"analyzer": {
"customanalyzer": {
"type": "custom",
@Mpdreamz
Mpdreamz / gist:6807074
Created October 3, 2013 08:44
default proxy set to fiddler to see web requests initiated by .net application/libraries
<system.net>
<defaultProxy>
<!-- Uncommment this line if you want to see web requests initiated by .NET (think WCF/REST calls)
REMEMBER TO UNDO THIS IF YOU CLOSE FIDDLER!
-->
<!--<proxy bypassonlocal="False" usesystemdefault="True" proxyaddress="http://127.0.0.1:8888" />-->
<proxy bypassonlocal="False" usesystemdefault="True" />
</defaultProxy>
</system.net>
@Mpdreamz
Mpdreamz / Request.json
Created May 27, 2013 13:02
Named Filters missing matched_filters
POST http://127.0.0.1:9200/nest_test_data-6612/elasticsearchprojects/_search?pretty=true HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: 127.0.0.1:9200
Content-Length: 429
Expect: 100-continue
{
"from": 0,
"size": 10,