Skip to content

Instantly share code, notes, and snippets.

View ShekharReddy4's full-sized avatar
💻
Graduated

Shekhar Reddy ShekharReddy4

💻
Graduated
  • Texas
  • 19:42 (UTC -05:00)
View GitHub Profile
@ShekharReddy4
ShekharReddy4 / explanation.md
Created May 10, 2018 21:29 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

Keybase proof

I hereby claim:

  • I am shekharreddy4 on github.
  • I am shekharreddy (https://keybase.io/shekharreddy) on keybase.
  • I have a public key ASAESihLvlV_itMRdQYMszMqsbnvEWZdulVr6wdYp5fwsgo

To claim this, I am signing this object:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.DirectoryServices;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1

Inspired by this article. Neat tricks for speeding up integer computations.

Note: cin.sync_with_stdio(false); disables synchronous IO and gives you a performance boost. If used, you should only use cin for reading input (don't use both cin and scanf when sync is disabled, for example) or you will get unexpected results.

Multiply by a power of 2

x = x << 1; // x = x * 2

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication9
{
public static class Configs
@ShekharReddy4
ShekharReddy4 / Config.cs
Created November 21, 2017 07:33
Event handling for logged in user and instllation and uninstallation of software
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication9
{
public static class Configs
$runPSCommand7=Send-SSMCommand -InstanceId $InstanceID -DocumentName AWS-RunPowerShellScript -Comment 'command in execution1' -Parameter @{'commands'=@('$WUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
$WUSettings.NotificationLevel=2
$WUSettings.save')}
@ShekharReddy4
ShekharReddy4 / README.md
Created October 21, 2017 10:54 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@ShekharReddy4
ShekharReddy4 / program.cs
Created September 27, 2017 15:56
super example explaining the roles and principals in .net framework
a