Skip to content

Instantly share code, notes, and snippets.

View naveensrinivasan's full-sized avatar

Naveen naveensrinivasan

View GitHub Profile
@naveensrinivasan
naveensrinivasan / test
Created October 5, 2015 14:55
Gist from LinqPad
Test file
@naveensrinivasan
naveensrinivasan / test
Created October 5, 2015 15:10
Gist from LinqPad
Test file
@naveensrinivasan
naveensrinivasan / test
Created October 5, 2015 23:15
Gist from LinqPad
Test file
@naveensrinivasan
naveensrinivasan / FileSnapShot.xml
Created December 3, 2015 00:09
Gist from LinqPad
<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<fileSnapshot xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n <files>\r\n <file path=\"C:\\ProgramData\\chocolatey\\lib\\AnkhSvn\\AnkhSvn.nupkg\" checksum=\"98836B6C04DC1F96553F77571E719A2C\" />\r\n <file path=\"C:\\ProgramData\\chocolatey\\lib\\AnkhSvn\\tools\\ChocolateyInstall.ps1\" checksum=\"40E6DDE5FDA6FD3813CC4174891EDA88\" />\r\n <file path=\"C:\\ProgramData\\chocolatey\\lib\\AnkhSvn\\tools\\ChocolateyUninstall.ps1\" checksum=\"C0D802F6439762B7BA7169090770F647\" />\r\n </files>\r\n</fileSnapshot>
@naveensrinivasan
naveensrinivasan / FilesSnapshot.xml
Created December 6, 2015 23:16
Gist created with unicode characters
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\applicationcompatibilitytoolkit\applicationcompatibilitytoolkit.nupkg" checksum="2A62F5DA567C00D30BEE5EDB0CBF1D09" />
<file path="C:\ProgramData\chocolatey\lib\applicationcompatibilitytoolkit\tools\chocolateyInstall.ps1" checksum="D7F8382EE4831301DD86A7CB49AEEA82" />
<file path="C:\ProgramData\chocolatey\lib\applicationcompatibilitytoolkit\tools\chocolateyUninstall.ps1" checksum="FF19EF6FDEE3A1CB53603FD52DA0538D" />
</files>
</fileSnapshot>
@naveensrinivasan
naveensrinivasan / test
Created December 6, 2015 23:18
Gist from LinqPad
Test file
@michael-newton-15below
michael-newton-15below / Interval.fs
Created January 22, 2013 15:52
Adaptive polling interval
let interval i =
let x = float i
let maxWait = 60. * 10.
let raisePower x = pown (x /10.) 4
(maxWait * (raisePower x)) / (raisePower x + 1.)
|> (*) 1000. |> int
@mfcollins3
mfcollins3 / NativeMethods.cs
Created June 29, 2013 06:03
Process Monitor is a great tool for finding and solving problems with programs in production environments. Along with the usual events that Process Monitor captures and logs, Process Monitor allows developers to send log messages to be included in the log so that process events can be correlated to program source code. This Gist contains the sou…
internal static class NativeMethods
{
[DllImport("kernel32.dll", CallingConvention = CallingConvention.WinApi,
EntryPoint = "CloseHandle", ExactSpelling = true, SetLastError = true)]
internal static extern bool CloseHandle(IntPtr handle);
[DllImport("kernel32.dll", CallingConvention = CallingConvention.WinApi,
CharSet = CharSet.Unicode, EntryPoint = "CreateFileW",
ExactSpelling = true, SetLastError = true)]
internal static extern IntPtr CreateFile(
@naveensrinivasan
naveensrinivasan / gh-dl-release
Created May 1, 2017 15:36 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@plaurin
plaurin / SelfCompile
Created October 7, 2012 21:00
Self Compiling LinqPad query
void Main()
{
Environment.CurrentDirectory = Path.GetDirectoryName(Util.CurrentQueryPath);
Compiler.CompileFiles(Options.CreateOnDiskDll(
@namespace: "LinqPad.QueriesCompiler",
outputFile: "LinqPad.QueriesCompiler.dll")
.AddCodeFile(CodeType.LinqProgramTypes, Util.CurrentQueryPath))
.Dump("Successfully created assembly at " + DateTime.Now.ToLocalTime());
}