Skip to content

Instantly share code, notes, and snippets.

View kinshuk4's full-sized avatar

Kinshuk kinshuk4

View GitHub Profile

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

@kinshuk4
kinshuk4 / StringManipulation.md
Created October 27, 2015 11:34 — forked from sarrionandia/StringManipulation.md
String Manipulation

#String Manipulation This is a free revision guide for GCSE Computer Science created by Tito Sarrionandia for http://LearnCompSci.uk

##Introduction As you will recall from the Selecting & Using Datatypes section, a String is a datatype. It is made up of a series of individual characters. They are used to represent textual data. For example, if you send a message to a friend online, the message is probably stored as a string in the messaging program.

We often use double quotes to represent a string, we will stick to that convention for this guide, like this:-

"Hello, World!"

Everything inside the quotes is part of the string.

Data Structures

1. Lists

  1. list.append(x), list[len(list):] = [x]
  2. list.extend(L), list[len(list):] = L
  3. list.insert(i, x)
  4. list.remove(x)
  5. list.pop(i), i is optional, if i is not specified, removes last one
  6. list.index(x)
  7. list.count(x)

Errors and Exceptions

1. Handle Exceptions

  • try ... except
while True:
	try:
		x = int(raw_input("Please enter a number: "))
		break