Skip to content

Instantly share code, notes, and snippets.

View rmad17's full-sized avatar
๐Ÿ“š
Learning Rust

Sourav rmad17

๐Ÿ“š
Learning Rust
View GitHub Profile
@rmad17
rmad17 / multiple_ssh_setting.md
Created December 20, 2016 08:12 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@rmad17
rmad17 / git.migrate
Created December 20, 2016 08:08 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@rmad17
rmad17 / find-forks.py
Created July 10, 2016 15:08 — forked from akumria/find-forks.py
A quick way to find all the forks of a particular github project.
#!/usr/bin/env python
import os
import urllib2
import json
import subprocess
user=None
repo=None
@rmad17
rmad17 / automation.md
Created June 19, 2016 17:32 — forked from cube-drone/automation.md
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

@rmad17
rmad17 / pyvenv-wrapper.sh
Created December 23, 2015 04:57
Bash wrappers for pyvenv with auto-complete activation
# Wrappers for pyvenv
#
# Source in .bashrc via 'source pyvenv-wrapper.sh'
PYVENV_DIR=$HOME/.pyvenv
PYVENV_BIN=pyvenv-3.4
function py-create-venv {
mkdir -p $PYVENV_DIR
$PYVENV_BIN $PYVENV_DIR/$1
@rmad17
rmad17 / Placeholder.css
Created November 4, 2015 09:33
Set style for placeholder
::-webkit-input-placeholder {
font-style: italic;
}
:-moz-placeholder {
font-style: italic;
}
::-moz-placeholder {
font-style: italic;
}
:-ms-input-placeholder {
@rmad17
rmad17 / tmux-cheatsheet.markdown
Created October 26, 2015 05:29 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rmad17
rmad17 / test.py
Created October 25, 2015 10:38
Optional Parameters
def test0(a, b, c=None, d=5):
print(a)
print(b)
print(c)
print(d)
test0(2, "C", "py3", 7)
test0(2, "PyCon")
@rmad17
rmad17 / Interview.md
Last active August 29, 2015 12:05
Medium Python Interview
  • #Problem Statement 1 You are given an array of integers, A. Use list comprehension in Python to count and print the number of odd numbers in A.

  • #Problem Statement 2

An Utopian Tree goes through 2 cycles of growth every year. The first growth cycle occurs during the spring, when it doubles in height. The second growth cycle occurs during the summer, when its height increases by 1 meter.

Now, a new Utopian Tree sapling is planted at the onset of spring. Its height is 1 meter. Can you find the height of the tree after N growth cycles?

Input Format

@rmad17
rmad17 / python_resources.md
Last active August 29, 2015 14:24 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides