Skip to content

Instantly share code, notes, and snippets.

View Ashwinning's full-sized avatar

Ashwin Sinha Ashwinning

View GitHub Profile
@Ashwinning
Ashwinning / OpenPowershellAsAdminOnRight-Click.md
Last active December 28, 2020 10:57
Open Powershell as Admin on Right-Click (Context Menu) #gistblog #windows #powershell

Open Powershell as Admin on Right-Click

I described how to set a context menu option to open a Powershell console on right click earlier.

To open Powershell as admin on right click, we can add a command to be executed on start to our registry entry like so

$stpath = pwd; Start-Process PowerShell -ArgumentList \"-NoExit\", \"-Command cd $stpath\" -verb RunAs

So our Command in the registry entry will look like the following

@Ashwinning
Ashwinning / AddOpenPowershellHereToContextMenu.md
Last active November 3, 2016 05:08
Add Open Powershell here to context menu #gistblog #windows #powershell

Add Open Powershell here to context menu

To add it to the Windows right click context menu, perform the following steps:

  • Open regedit from the run menu Win + R.

  • Under HKEY_CLASSES_ROOT\Directory\Background\shell create a key called Powershell.

@Ashwinning
Ashwinning / AddBashonUbuntuonWindowsToContextMenu.md
Last active April 11, 2022 14:31
Add Bash on Ubuntu on Windows to context menu #gistblog #ubuntu #bash #windows

Add Bash on Ubuntu on Windows to context menu

Bash on Ubuntu on Windows (installation instructions) is a Linux Subsystem for Windows.

To add it to the Windows right click context menu, perform the following steps:

  • Open regedit from the run menu Win + R.

Not sure if I'm an idiot or if Jekyll fucking sucks

I started experimenting with Jekyll a while ago, trying to put together a blog hosted on github.

  • I create a css file, add some code to it.

@Ashwinning
Ashwinning / EnableDisableHyperV.md
Created June 9, 2016 00:22
Powershell scripts to enable disable Hyper-V.

Open Powershell as admin

To Enable

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All

To Disable

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
@Ashwinning
Ashwinning / OpenCVTextureinOpenGL.md
Last active May 21, 2023 11:54
Using webcam video as texture in OpenGL

OpenCV Texture in OpenGL.

The following code was found at http://www.alecjacobson.com/weblog/?p=1875

The page suffered from bad formatting so the contents have been pasted here for easier readibility.

// Modified from "Video Texture" code
// Copyright (C) 2009  Arsalan Malik (arsalank2@hotmail.com)
//                                                                            
@Ashwinning
Ashwinning / GetFilesOfTypeInDirectoryAndSort.md
Last active November 6, 2020 14:33
Getting all files of a specific type, in a specified folder using Boost. (returned in alphabetical order) #gistblog #boost #c++

Getting all files of a specific type, in a specified folder using Boost. (returned in alphabetical order)

//Accepts a path to a directory
//a file extension
//and a list
//Puts all files matching that extension in the directory into the given list.
//Sorts and returns the results
void GetFilesOfTypeInDirectory(const boost::filesystem::path &directoryPath, const string &fileExtension, std::vector<boost::filesystem::path> &list)
{

Structure

Element Value Value Value
[0] TOTAL_NUMBER_OF_POINTS CONTAINS_COLOR_DATA COMPRESSED
[1] Vector3[1].x Vector3[1].y Vector3[1].z
[2] Vector3[2].x Vector3[2].y Vector3[2].z
[3] Vector3[3].x Vector3[3].y Vector3[3].z
[4] Color[1].r Color[1].g Color[1].b
[5] Color[2].r Color[2].g Color[2].b
@Ashwinning
Ashwinning / PointCloudSavingExample.cs
Created April 19, 2016 22:33
The following example saves a Vector 3 List to a '.cloud' file.
using UnityEngine;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
/// <summary>
/// The following example saves a Vector 3 List to a '.cloud' file.
/// </summary>
@Ashwinning
Ashwinning / librealsenseColorIntrinsicPrinter.cpp
Last active February 6, 2018 06:56
Prints out the color intrinsics of a realsense camera with the librealsense library.
std::cout << " COLOR INTRINSICS \n ";
std::cout << "width : " + color_intrin.width << std::endl;
std::cout << "height : " + color_intrin.height << std::endl;
std::cout << "fx : " + std::to_string(color_intrin.fx) << std::endl;
std::cout << "fy : " + std::to_string(color_intrin.fy) << std::endl;
std::cout << "ppx : " + std::to_string(color_intrin.ppx) << std::endl;
std::cout << "ppy : " + std::to_string(color_intrin.ppy) << std::endl;
std::cout << "distortion coefficients : " << std::endl;
int loop = 1;
for (int coefficient : color_intrin.coeffs)