Skip to content

Instantly share code, notes, and snippets.

View kinshuk4's full-sized avatar

Kinshuk kinshuk4

View GitHub Profile
package com.vaani.hackerrank;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Created by mdev on 4/8/15.
*/
package com.vaani.java.gc;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
public class MappedFileGc {
public static void main(String[] args) throws IOException {
@kinshuk4
kinshuk4 / Python-Multiple-Environment.md
Last active September 13, 2016 05:30
Installing multiple versions of python on Mac using Brew,VirtualEnv and VirtualEnvWrapper

Setting up the VirtualEnv with Brew

Here we will use Homebrew as my package manager for Unix utilities on OSX. Homebrew seems to install less dependencies than Macports or Fink.

Also, most of my Python development has settled on Python 2.7 and occasionally Python 3 for tasks that don’t require external libraries that only run on Python 2.x. So for me, an easier install with less gunk on my hard drive is a fair trade for losing the latest updates to Python 2.4, 2.5, and 2.6.

In this post, I’ll describe my setup.

The first thing to do is uninstall Macports if present. Homebrew has fairly up-to-date versions all of the Unix packages I use on a daily basis, including git, subversion, bash_completion, Python, Qt, PyQt, and their supporting libraries. As such, I don’t need Macports taking up additional hard drive space and potentially causing conflicts with Homebrew’s packages.

Git Cheat Sheet

Visit my blog or connect with me on Twitter

Overview

Centralized version control - SVN,Perforce Localized version control - Git,Mercurial

Git creates only 1 .git folder, while svn creates lots of svn folder.

Commands

@kinshuk4
kinshuk4 / GithubCheatSheet.md
Last active October 26, 2015 14:17 — forked from kickroot/gist:4204368
Github cheat sheet

We have already seen git commands here, hence won't be repeating it.

Change to your project root folder and do this initially to get your repo set up

# Link remote repo with you local repo.
git remote add alias <Your repo URL>

# Example - Note origin instead of alias
git remote add origin <Your repo URL>
@kinshuk4
kinshuk4 / ELK-Stack.md
Last active November 24, 2015 07:51 — forked from roncat/ELK
Stack ELK

#ELK Stack

The ELK stack contains Elasticsearch, Logstash, and Kibana:

  • Elasticsearch for deep search and data analytics
  • Logstash for centralized logging, log enrichment and parsing
  • Kibana for powerful and beautiful data visualizations

The architecture ELK:

send data storage data reads data 
@kinshuk4
kinshuk4 / ruby-tutorial.md
Last active October 27, 2015 10:01 — forked from shin1ohno/rt_1_2.md
ruby tutorial

first ruby tutrial

Environment Setup

  • install XCode: search 'xcode' in app store and install
  • install 'command line tools': after XCode installed in XCode, install from it's preference pane
  • install home brew: open up terminal, and type ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
  • install rbenv: open up terminal, and type brew install rbenv
  • as said, echo 'eval "$(rbenv init -)"' >> .bashrc', then close terminal window and open again
  • install ruby-build: in the terminal, and type brew install ruby-build
@kinshuk4
kinshuk4 / wwg-go-tutorial.md
Created October 27, 2015 09:00 — forked from nitya/wwg-go-tutorial.md
WomenWhoGo-GoTutorials: Troubleshooting
@kinshuk4
kinshuk4 / ActiveRecords.md
Created October 27, 2015 10:01 — forked from steverob/ar-workshop.md
ActiveRecord tutorial for Chennai.rb workshop

ActiveRecord

Let's create a MovieDB app to learn AR :)

The Tables

datamodel

The Models

$ rails generate model genre name:string

$ rails g model movie name:string release_date:date revenue:decimal genre_id:integer