Skip to content

Instantly share code, notes, and snippets.

View blakshmikanth's full-sized avatar

Lakshmikanth blakshmikanth

View GitHub Profile
@blakshmikanth
blakshmikanth / Program.cs
Created November 2, 2021 04:09
Challenge: Find minimum distance for each facility
using System;
using System.Collections.Generic;
namespace ShortDistance
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
@blakshmikanth
blakshmikanth / sysctl.conf
Created September 22, 2021 10:22 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@blakshmikanth
blakshmikanth / jquery-post.js
Created June 24, 2019 04:29
Send Http POST request using ajax()
$.ajax('/jquery/submitData', {
type: 'POST', // http method
data: { myData: 'This is my data.' }, // data to submit
success: function (data, status, xhr) {
$('p').append('status: ' + status + ', data: ' + data);
},
error: function (jqXhr, textStatus, errorMessage) {
$('p').append('Error' + errorMessage);
}
});
@blakshmikanth
blakshmikanth / WriteLog.vbs
Last active August 25, 2016 16:41
Logging function using vbscript
Const ForAppending = 8
Const LOG_FOLDER = "C:\Temp\"
Const LOG_FILE = "test"
Const LOG_FILE_EXTENSION = ".log"
Const LOG_FILE_SEPARATOR = "_"
'Log message with timestamp
sub WriteLog(message)
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Get log file with current date
@blakshmikanth
blakshmikanth / JsonMessageFormatter.cs
Created August 15, 2016 10:14 — forked from jchadwick/JsonMessageFormatter.cs
MSMQ Message JSON Formatter
using System;
using System.IO;
using System.Messaging;
using System.Text;
using Newtonsoft.Json;
public class JsonMessageFormatter : IMessageFormatter
{
private static readonly JsonSerializerSettings DefaultSerializerSettings =
new JsonSerializerSettings {
string settings = File.ReadAllText(@"C:\Users\johannes.rudolph\Documents\Visual Studio 2015\Settings\jrMonokai.vssettings");
var map = new Dictionary<string, string>()
{
{"Brace Matching (Rectangle)", "brace matching" },
{"String(C# @ Verbatim)", "string - verbatim" },
{"User Types", "class name"},
{"User Types(Enums)", "enum name"},
{"User Types(Interfaces)", " interface name"},
{"User Types(Delegates)", "delegate name"},
@blakshmikanth
blakshmikanth / ConvertToLocalTime.sql
Last active August 29, 2015 14:06
To show last loggedIn time in CCPulse.
create function converttolocaltime (@timestamp int)
returns datetime
as
begin
declare @ret datetime
declare @offset bigint, @localdate bigint;
set @offset = datediff(second,getdate(),getutcdate());
set @localdate = @timestamp - @offset;
select @ret = dateadd(second, @localdate, '1970/01/01 00:00:00')
return @ret
@blakshmikanth
blakshmikanth / 0_reuse_code.js
Created August 29, 2014 11:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console