Skip to content

Instantly share code, notes, and snippets.

View cybersiddhu's full-sized avatar

Siddhartha Basu cybersiddhu

View GitHub Profile
@cybersiddhu
cybersiddhu / starship.nix
Created October 5, 2022 18:08 — forked from s-a-c/starship.nix
Nix file to generate complete, mostly default, starship.toml, including equivalent of <format = "$all">
programs.starship = {
enable = true;
settings = {
# "$schema" = "https://starship.rs/config-schema.json";
add_newline = true;
command_timeout = 500;
continuation_prompt = "[∙](bright-black) ";
format = "[](0x9A348E)$username$hostname$localip$shlvl$singularity$kubernetes[](fg:0x9A348E bg:0xDA627D)$directory$vcsh[](fg:0xDA627D bg:0xFCA17D)$git_branch$git_commit$git_state$git_metrics$git_status$hg_branch[](fg:0x86BBD8 bg:0x06969A)$docker_context$package$buf[](fg:0xFCA17D bg:0x86BBD8)$c$cmake$cobol$container$daml$dart$deno$dotnet$elixir$elm$erlang$golang$haskell$helm$java$julia$kotlin$lua$nim$nodejs$ocaml$perl$php$pulumi$purescript$python$rlang$red$ruby$rust$scala$swift$terraform$vlang$vagrant$zig$nix_shell$conda$spack$memory_usage$aws$gcloud$openstack$azure$env_var$crystal$custom$sudo$cmd_duration$line_break$jobs$battery[](fg:0x06969A bg:0x33658A)$time$status$shell$character";
right_format = "";
scan_timeout = 30;
@cybersiddhu
cybersiddhu / rust-command-line-utilities.markdown
Created October 2, 2022 12:30 — forked from sts10/rust-command-line-utilities.markdown
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

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, exa, fd, hyperfine, miniserve, ripgrep, just, zoxide and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
  • bat: A replacement for cat that provides syntax highlighting and other features.
  • bottom: Yet another cross-platform graphical process/system monitor.
@cybersiddhu
cybersiddhu / launch.js
Created February 18, 2021 16:32 — forked from rw3iss/launch.js
browsersync script to hot reload any client project
const bs = require('browser-sync').create();
// Config params (relative to where npm/script is called from):
const PORT = 3000;
const OUTPUT_DIR = './build';
bs.watch(`${OUTPUT_DIR}/**/*.js`, function (event, file) {
bs.reload("*.js");
})
@cybersiddhu
cybersiddhu / build.js
Created February 18, 2021 16:30 — forked from rw3iss/build.js
esbuild.js frontend build script
var fs = require("fs");
var path = require("path");
// Config params (relative to where npm/script is called from):
const APP_BASE = './src';
const ENTRY_FILE = `index.tsx`;
const OUTPUT_DIR = './build';
const OUTPUT_FILE = 'app.js';
const IS_DEV = false;
const TARGET = 'es2018';
@cybersiddhu
cybersiddhu / macapp.go
Created February 6, 2021 19:24 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@cybersiddhu
cybersiddhu / falcorApp.jsx
Last active August 29, 2015 14:28 — forked from btholt/falcorApp.jsx
Falcor + React
const React = require('react');
const _ = require('lodash');
var model = new falcor.Model({
cache: {
movies: [
{
title: "Daredevil",
plot: "Marvel lol",
year: "2015-",
var backendData = [
{
"title":"Section 1",
"content":"Our content for the section 1"
},
{
"title":"Section 2",
"content":"Our content for the section 2"
},
{
'use strict';
var React = require('react/addons');
var AnimateMixin = require('react-animate');
/**
* Accordion object that maintains a list of content containers and their collapsed or expanded state
* @type {*|Function}
*/
var Accordion = React.createClass({
/**
import React from 'react/addons';
const TestUtils = React.addons.TestUtils;
export default createComponent;
function createComponent(component, props, ...children) {
const shallowRenderer = TestUtils.createRenderer();
shallowRenderer.render(React.createElement(component, props, children.length > 1 ? children : children[0]));
return shallowRenderer.getRenderOutput();
}

Selectively applying path markers from a simple collection.