Skip to content

Instantly share code, notes, and snippets.

@hiteshjasani
hiteshjasani / parsing_from_json.nim
Last active April 21, 2020 13:45
Nim variants and json
import json
type
Kind = enum
kFoo, kBar
Baz = object
name: string
case kind: Kind
of kFoo: iAge: int
@hiteshjasani
hiteshjasani / backup-config.md
Last active May 27, 2018 15:18
Backup Configuration

Backup Providers

  • Mac and Windows backup applications
  • Linux supported through scripts to Backblaze B2 (Object Storage) service

Caveats

  • Expicitly disallows backing up of /usr/, so anything installed in /usr/local/ via Homebrew will NOT be backed up!
@hiteshjasani
hiteshjasani / systemctl-cheatsheet.md
Created April 4, 2018 17:11
systemctl cheatsheet
Command Desc
systemctl status <service>
systemctl status docker
Get service status
systemctl stop <service>
systemctl stop docker
Stop service
systemctl start <service>
systemctl start docker
Start service
@hiteshjasani
hiteshjasani / cljs.md
Last active March 21, 2018 14:58
Enabling a cljs command line

Creating your own cljs command

Mike Fikes mentioned that he's suggested creating a cljs command for the command line that is similar to the current clj command. It sounds like a good idea that might take some time to get momentum. In the interim, you can create your own.

Option 1

Setup

Advantage is that it doesn't pollute your deps.edn for non-javascript work.

@hiteshjasani
hiteshjasani / gpg-lein-clojars-cheatsheet.md
Last active March 3, 2018 04:25
GPG, lein and clojars

Solution

$ GPG_TTY=$(tty) lein deploy clojars

This will pop up an ascii window asking for the password to the key. It then continues with the deploy to clojars.

@hiteshjasani
hiteshjasani / Makefile
Last active February 26, 2018 17:15
Clojurescript synthetic index examples
run:
clj -Sdeps '{:paths ["."] :deps {org.clojure/clojurescript {:git/url "https://github.com/clojure/clojurescript" :sha "ec0e4c49fa5bf97d6c8b5a8e5d3bd957855bfe56"}}}' -m cljs.main -re browser -c index -r
run-reagent:
clj -Sdeps '{:paths ["."] :deps {org.clojure/clojurescript {:git/url "https://github.com/clojure/clojurescript" :sha "ec0e4c49fa5bf97d6c8b5a8e5d3bd957855bfe56"} reagent {:mvn/version "0.8.0-alpha2"}}}' -m cljs.main -re browser -c index-reagent -r
@hiteshjasani
hiteshjasani / homebrew-cheatsheet.md
Last active February 16, 2018 16:58
Homebrew cheatsheet
Command Desc
brew update Update brew package info
brew upgrade <package-name> Install new version of package
brew info <package-name> See which version is linked
brew ls <package-name> --versions List package versions
brew ls <package-name> List files in package
brew switch <package-name> <version> Link to specified version of package
brew cleanup Remove outdated package versions
@hiteshjasani
hiteshjasani / tensorflow_build.sh
Last active October 15, 2020 08:26
Building tensorflow using Bazel with cpu optimizations
# Install bazel
# download tensorflow src
# Checkout tagged version
# ./configure
# Compile
bazel build -c opt --copt=-march=native //tensorflow/tools/pip_package:build_pip_package
#bazel build -c opt --copt=-mavx --copt=-msse4.1 --copt=-msse4.2 //tensorflow/tools/pip_package:build_pip_package
# Build the PIP package
@hiteshjasani
hiteshjasani / clojars.md
Last active November 10, 2022 08:34
Clojars instructions

Publish Release

  1. Update version in project.clj
  2. lein deploy clojars

Setup

Project

1. Ensure prefix is on project in project.clj

@hiteshjasani
hiteshjasani / sysctl.yml
Created November 22, 2016 17:16 — forked from jkordish/sysctl.yml
ansible sysctl for ec2. perferrably used for 1g nics.
- hosts: localhost
tasks:
- name: update sysctl
action: sysctl state=present reload=yes {{ item }}
with_items:
# max open files
- name=fs.file-max value=65535
# lets not use swap.
- name=vm.swappiness value=0
# enable syn coockies. this can actually cause overhead.