Skip to content

Instantly share code, notes, and snippets.

Avatar
😎

Gaurav Kamath st0le

😎
View GitHub Profile
@st0le
st0le / killall.ps1
Created May 20, 2020 — forked from ReubenBond/killall.ps1
killall cmd for PowerShell with completion
View killall.ps1
# In a PS terminal, type "code $profile" and put this in there
function killall {
param(
[ArgumentCompleter(
{
param($cmd, $param, $values)
get-process |
? { $_.Name.StartsWith($values, [StringComparison]::OrdinalIgnoreCase) } |
Sort -Unique Name |
@st0le
st0le / PlaysTvDownloader.ps1
Last active Jan 5, 2020
Downloads all public videos of a user
View PlaysTvDownloader.ps1
# Copy and paste this in a Powershell window. Enter the userId at the prompt. Follow instruction below to get your userId
# download all PlaysTv videos of a user
# To find the user id, navigate to the your profile while logged in (IMPORTANT!)
# View source of the page, In the <html> tag there's data-conf attribute.
# The json in there will have the user id under [login_user.id]
function Safe-Title {
param (
$Description,
$EpochMilliseconds
@st0le
st0le / DraculaMod
Last active Aug 23, 2019
Windows Terminal Theme
View DraculaMod
{
"background": "#282A36",
"black": "#21222C",
"blue": "#F1FA8C",
"brightBlack": "#6272A4",
"brightBlue": "#D6ACFF",
"brightCyan": "#A4FFFF",
"brightGreen": "#69FF94",
"brightPurple": "#FF92DF",
"brightRed": "#FF6E6E",
@st0le
st0le / UbuntuLegit.json
Created Aug 9, 2019
UbuntuLegit Windows Terminal Scheme
View UbuntuLegit.json
{
"background": "#2C001E",
"black": "#4E9A06",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
View popcount.py
def popcount(n):
c = 0
while n != 0:
c += n % 2
n //= 2
return c
def popcount_range_naive(n):
return sum(map(popcount, range(n + 1)))
View keybase.md

Keybase proof

I hereby claim:

  • I am ST0LE on github.
  • I am gauravkamath (https://keybase.io/gauravkamath) on keybase.
  • I have a public key whose fingerprint is AC20 EC1E 4274 DA5F 32E4 4704 B9C9 97B3 05BE A391

To claim this, I am signing this object:

@st0le
st0le / Find-FirstItem.ps1
Last active Mar 22, 2018
Simple Utility Function
View Find-FirstItem.ps1
Function Find-FirstItem {
[CmdletBinding()]
[Alias("ffi")]
param(
[Parameter(Mandatory, Position = 0)]
[ValidateNotNullOrEmpty()]
[string] $Filter
)
Get-ChildItem -Recurse -Filter $Filter | Select-Object -First 1 -ExpandProperty FullName
}
View Systray.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace MyTrayApp
{
public class SysTrayApp : Form
{
[STAThread]
public static void Main()
@st0le
st0le / MediaKeys.ahk
Created Nov 14, 2017
Add MediaKey shortcuts to normal keyboard
View MediaKeys.ahk
; ^ = Ctrl
; volume up
^Numpad8::Volume_Up
; volume down
^Numpad2::Volume_Down
; volume mute
^Numpad0::Volume_Mute
@st0le
st0le / autoexec.cfg
Last active Jul 16, 2017
autoexec.cfg
View autoexec.cfg
alias +jumpthrow "+jump;-attack"
alias -jumpthrow "-jump"
bind mouse3 +jumpthrow
bind mouse5 +voicerecord
alias +fwdjumpthrow "+forward;+jump;-attack"
alias -fwdjumpthrow "-forward;-jump"
bind capslock +fwdjumpthrow
exec buyscript;
alias +djump "+jump; +duck"
alias -djump "-jump; -duck"
You can’t perform that action at this time.