Skip to content

Instantly share code, notes, and snippets.

@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 4, 2024 23:11
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@woonketwong
woonketwong / selectionRank
Last active October 3, 2023 13:18
Selection Rank is a well known algorithm in computer science to find the ith smallest (or largest) element in an array in linear time. If the elements are unique, you can find the ith smallest or largest element in expected O(n) time. The code below implements finding the ith smallest element in javascript.
var selectionRank = function(array, rank){
// randomly select a pivot
var pivotIndex = Math.floor( (Math.random() * array.length) );
var pivot = array[pivotIndex];
// left array stores the smallest <rank> elements in the array
var leftArr = [];
var rightArr = [];
// partition into left and right arrays
for (var i = 0; i < array.length; i++){
@woonketwong
woonketwong / jugglingDBWithPostgres
Last active December 29, 2015 05:09
JugglingDB with Postgres
var q = require('q');
var Schema = require('jugglingdb').Schema;
var schema = new Schema('postgres', {
database: 'woonketwong',
username: 'woonketwong'
});
// The first argument to schema.define is the table
// and schema name. Do not use any capital letter
// in the table name because the database create table
@amattn
amattn / automatedBuildAndUploadToTestflight.sh
Created April 17, 2012 23:24
Automated Xcode build and upload to TestFlight.
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"