Skip to content

Instantly share code, notes, and snippets.

View snapfast's full-sized avatar
🔥
Burning

Rahul Bali snapfast

🔥
Burning
View GitHub Profile
# Courtesy of https://stackabuse.com/sorting-algorithms-in-python/
def partition(nums, low, high):
# We select the middle element to be the pivot. Some implementations select
# the first element or the last element. Sometimes the median value becomes
# the pivot, or a random one. There are many more strategies that can be
# chosen or created.
pivot = nums[(low + high) // 2]
i = low - 1
j = high + 1
@standit
standit / getOrCreateConfigurationElement.js
Last active June 16, 2021 12:42
Get or Create vRO Configuration Element
// VMware vRealize Orchestrator action sample. Valid for vRA/vRO 7.0+
//
// Get or Create a Configuration Element
//
// Action Inputs:
// categoryPath string Configuration Category Path (full path)
// configName string Name of Configuration Element
//
// Action Output:
// return type: ConfigurationElement
@amrza
amrza / aria.sh
Created April 21, 2018 15:50
Download List of files with aria2
#!/bin/sh
aria2c --dir=./ --input-file=urls.txt --max-concurrent-downloads=1 --connect-timeout=60 --max-connection-per-server=16 --split=16 --min-split-size=1M --human-readable=true --download-result=full --file-allocation=none
date
# Now create this file in the same directory and paste all urls in it: urls.txt
@bast
bast / jekyll-installation-arch.sh
Last active March 15, 2024 20:13
Jekyll installation on Arch Linux.
sudo pacman -S ruby ruby-rdoc gcc make
gem update --user-install
gem install jekyll --user-install
# finally add $HOME/.gem/ruby/2.7.0/bin to your PATH variable
@munim
munim / youtube-dl-download-pluralsight.md
Last active July 28, 2022 21:19
youtube-dl to download pluralsight videos

Download Plural Sight videos

Software required:

youtube-dl

After installation and putting the youtube-dl in PATH

youtube-dl \
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@entaroadun
entaroadun / gist:1653794
Created January 21, 2012 20:10
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// This example shows how to render pages that perform AJAX calls
// upon page load.
//
// Instead of waiting a fixed amount of time before doing the render,
// we are keeping track of every resource that is loaded.
//
// Once all resources are loaded, we wait a small amount of time
// (resourceWait) in case these resources load other resources.
//
// The page is rendered after a maximum amount of time (maxRenderTime)