Skip to content

Instantly share code, notes, and snippets.

View saurabhj's full-sized avatar
🏠
Working from home

Saurabh Jain saurabhj

🏠
Working from home
View GitHub Profile
@saurabhj
saurabhj / aws_s3_bucket_permission.md
Last active November 9, 2022 08:37
AWS S3 Give permission to one specific S3 bucket

Name of bucket: my-bucket

{
  "Statement": [
    {
      "Action": "s3:*",
      "Effect": "Allow",
      "Resource": [
 "arn:aws:s3:::my-bucket",
@saurabhj
saurabhj / bookmarks.md
Created November 12, 2019 08:13
Bookmarks
@saurabhj
saurabhj / Keybase.md
Created May 29, 2019 19:23
keybase.md

Keybase proof

I hereby claim:

  • I am saurabhj on github.
  • I am saurabhj (https://keybase.io/saurabhj) on keybase.
  • I have a public key ASCJ8pdf_-15fT2-w7rVZ5YxrEOynXArSDxkAKzAiYaAcgo

To claim this, I am signing this object:

@saurabhj
saurabhj / git_commands.md
Last active December 4, 2019 11:22
Git Undo Stuff
@saurabhj
saurabhj / DownloadChromeFromPowershell
Created January 14, 2017 06:33
Download Chrome via Powershell
#Copy via: https://gist.github.com/kurokikaze/350fe1713591641b3b42#gistcomment-1754878
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)
@saurabhj
saurabhj / TableAndRows.sql
Last active November 23, 2016 09:38
Tables and their Rows in MS-SQL
-- Returns a list of all User created tables on MS-SQL along with a count of rows of each
SELECT o.NAME,
i.rowcnt
FROM sysindexes AS i
INNER JOIN sysobjects AS o ON i.id = o.id
WHERE i.indid < 2 AND OBJECTPROPERTY(o.id, 'IsMSShipped') = 0
ORDER BY o.NAME
@saurabhj
saurabhj / 0_reuse_code.js
Created April 1, 2016 10:46
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