Skip to content

Instantly share code, notes, and snippets.

View Ashwinning's full-sized avatar

Ashwin Sinha Ashwinning

View GitHub Profile
@Ashwinning
Ashwinning / Top-5-Electoral-Power-By-Turnout.md
Last active November 14, 2016 09:56
Top 5 States : Electoral Power by Voter Turnout
State Electoral-Votes Estimated-Ballots-Cast-In-2016 Voters-Per-Elector Weight
Wyoming 3 259,000 86333.33333 288.46%
District of Columbia 3 288,000 96000 259.42%
Alaska 3 315,000 105000 237.18%
Vermont 3 321,000 107000 232.75%
Hawaii 4 437,600 109400 227.64%
@Ashwinning
Ashwinning / Super Simple Python Timer.md
Last active December 27, 2020 00:40
Super Simple Python Timer #gistblog #python

Super Simple Python Timer

Timer module for python to measure elapsed time.

Import

Copy Timer.py to the same folder as your python files.

Linux

wget "https://gist.githubusercontent.com/Ashwinning/313a4bed6af3f7599ac168c4de82b555/raw/Timer.py"
@Ashwinning
Ashwinning / HowToOpenAnotherTerminal-BashInstanceInARunningDockerContainer.md
Last active February 17, 2022 18:26
How To Open Another Terminal/Bash Instance In A Running Docker Container #gistblog #bash #docker

How To Open Another Terminal/Bash Instance In A Running Docker Container

Add the following to your bashrc.

#Add another docker window
function dock()
{
  if [ "$1" == "-h" ]
 then
@Ashwinning
Ashwinning / internet-is-slow-on-windows.md
Last active July 29, 2016 22:47
Internet speeds on Windows appear to hover around 3 Mbps while on the same machine, everything works fine on my dual booted Ubuntu installation.

[Solved] Internet is slow on windows

I'm facing a weird issue where my internet speeds on Windows appear to hover around 3Mbps while on the same machine, everything works fine on my dual booted Ubuntu installation.

A hardware / router / placement problem can be ruled out, since the everything is functioning completely fine in the other dual booted operating system.

@Ashwinning
Ashwinning / IntArrayToString.cs
Created July 20, 2016 03:47
Convert Int[] Array to string in C#
/// <summary>
/// Returns comma separated string containing each int from an Array.
/// </summary>
/// <param name="ints"></param>
/// <returns></returns>
public string IntArrayToString(int[] ints)
{
return string.Join(",", ints.Select(x => x.ToString()).ToArray());
}
@Ashwinning
Ashwinning / how-to-disable-microsoft-virtual-wifi-network.md
Created July 15, 2016 07:14
How to disable wifi microsoft virtual wifi adapter.

How to disable Microsoft WiFi Direct Virtual Adapter


**I think ** this is how it worked

As Admin

netsh wlan stop hostednetwork
@Ashwinning
Ashwinning / version-control-your-bash-rc-file-with-gist.md
Last active October 4, 2023 00:09
Version control your `.bashrc` file (or any other file) with Github Gist #gistblog #ubuntu #bash

Version control your .bashrc file with Github Gist

Install Gist on your machine

If you have ruby installed (how to install ruby):

sudo gem install gist

‌If you're using Bundler:

@Ashwinning
Ashwinning / ShortenGitPathInCurrentTerminalInstance.md
Last active July 8, 2016 04:04
Shorten prompt path in current terminal instance.
@Ashwinning
Ashwinning / GetRandomPointBetweenTwoCircles.md
Last active November 3, 2016 05:14
Getting a random point between two concentric circles in Unity3D #gistblog #unity3d #c#

Getting a random point between two concentric circles in Unity3D

/// <summary>
/// Returns a random point in the space between two concentric circles.
/// </summary>
/// <param name="minRadius"></param>
/// <param name="maxRadius"></param>
/// <returns></returns>
Vector3 GetRandomPointBetweenTwoCircles(float minRadius, float maxRadius)
# install dependencies
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev