Skip to content

Instantly share code, notes, and snippets.

Avatar

vasani83 cvasani

View GitHub Profile
@cvasani
cvasani / virtualenvwrapper.md
Created Aug 6, 2020 — forked from dongzhuoyao/virtualenvwrapper.md
virtualenvwrapper Cheat Sheet
View virtualenvwrapper.md

local setting

PATH=$PATH:~/.local/bin
source /home/tao/.local/bin/virtualenvwrapper.sh
pip install virtualenvwrapper --user #make everything locally!!

vim, zsh is very hard to install locally without sudo permission.

@cvasani
cvasani / JavaStreamExampleMain.java
Created Aug 2, 2020 — forked from h0tk3y/Main.java
Some Java 8 Streams examples
View JavaStreamExampleMain.java
package ru.ifmo.ctddev.igushkin.streamExamples;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
@cvasani
cvasani / bash-cheatsheet.sh
Created Jul 29, 2020 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
View Java Collections Complexity cheatsheet
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@cvasani
cvasani / helpful-docker-commands.sh
Last active May 30, 2019 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
View helpful-docker-commands.sh
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
#Awk command expat NR> 1 as argument to work on pipe
@cvasani
cvasani / docker-help.md
Created May 30, 2019 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips
View docker-help.md

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@cvasani
cvasani / Main.scala
Created May 25, 2019 — forked from jkpl/Main.scala
Ways to pattern match generic types in Scala
View Main.scala
object Main extends App {
AvoidLosingGenericType.run()
AvoidMatchingOnGenericTypeParams.run()
TypeableExample.run()
TypeTagExample.run()
}
class Funky[A, B](val foo: A, val bar: B) {
override def toString: String = s"Funky($foo, $bar)"
}
View rxjs_operators_by_example.md
@cvasani
cvasani / notes_programming_in_scala.md
Created May 14, 2019 — forked from jamesyang124/notes_programming_in_scala.md
Notes for programming in Scala 2nd edition.
View notes_programming_in_scala.md

#Note for Programming in Scala


##Chp.0 SBT & Scala Interpreter

  1. Call scala interpreter by sbt.

    // enter scala interpreter
@cvasani
cvasani / curl reference
Created Mar 3, 2019 — forked from afair/curl reference
Curl command reference with options sorted by category for easier usage than that man page.
View curl reference
==========================================
CURL COMMAND
==========================================
Format curl [options] [URL...]
Quick Ref:
curl -X POST http://example.com/ <= Method option and URL (Options come before or after URL)
-H "Authorization: <data>" <= Add HTTP Header (like Authorization)
You can’t perform that action at this time.