Skip to content

Instantly share code, notes, and snippets.

View naveensrinivasan's full-sized avatar

Naveen naveensrinivasan

View GitHub Profile
@stephanos
stephanos / build.gradle
Created January 27, 2014 09:48
Gradle: Automate IntelliJ IDEA project generation for a Java App Engine project
def jvmRunFlags = '''
-Xmx700m
- ...
'''.split().toList()
def jvmTestFlags = '''
-Dlocally=true
-ea
- ...
'''.split().toList()
@ideaoforder
ideaoforder / godaddy-ssl-howto
Created April 8, 2014 16:30
GoDaddy + Nginx SSL
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
http://support.godaddy.com/help/article/3601/generating-a-certificate-signing-request-nginx
http://support.godaddy.com/help/article/4976/rekeying-an-ssl-certificate
# Be sure to remember to chain them!
cat gd_bundle-g2-g1.crt >> yourdomain.crt
# Move 'em
sudo mv yourdomain.crt /etc/ssl/certs/yourdomain.crt
@igrigorik
igrigorik / gist:3148848
Created July 20, 2012 05:24
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
@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());
}
@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
#
@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(
@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
@naveensrinivasan
naveensrinivasan / test
Created December 6, 2015 23:18
Gist from LinqPad
Test file
@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 / 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>