Skip to content

Instantly share code, notes, and snippets.

@nivir
nivir / sublime-clean
Created July 24, 2020 10:47 — forked from gerardroche/sublime-clean
Clean Sublime Text caches and optionally clean out any sessions
# 301 https://github.com/gerardroche/dotfiles
@nivir
nivir / sublime-clean
Created July 24, 2020 10:47 — forked from gerardroche/sublime-clean
Clean Sublime Text caches and optionally clean out any sessions
# 301 https://github.com/gerardroche/dotfiles
@nivir
nivir / Munene.py
Created July 6, 2020 20:45 — forked from PierraKimathi-zz/Munene.py
Munene Word Search
"""
Munene is extremely disappointed to find out that no one in the office knows his first name. Even his close mates call him only by his last name. Frustrated, he decides to make his fellow workmates know his first name by forcing them to solve this question.
You are given a long string as input in each testcase, containing any ASCII character. Your task is to find out the number of times SUVO and SUVOJIT appears in it.
Note: This problem CAN BE SOLVED IN Java, Python or PHP.
Input Format
The first line contains the number of testcases, T. Next, T lines follow each containing a long string S.
Output Format
For each long string S, display the no. of times SUVO and SUVOJIT appears in it."""
@nivir
nivir / update_git_repos.sh
Created June 29, 2020 00:05 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
from google.colab import files
uploaded = files.upload()
import io
df = pd.read_csv(io.BytesIO(uploaded['haberman.csv']))
age operation_year axil_nodes status
30 64 1 1
30 62 3 1
30 65 0 1
31 59 2 1
31 65 4 1
33 58 10 1
33 60 0 1
34 59 0 2
34 66 9 2
@nivir
nivir / combinations.py
Created July 14, 2018 23:39 — forked from dougwt/combinations.py
Python: All Possible Combinations
def combinations(n, list, combos=[]):
# initialize combos during the first pass through
if combos is None:
combos = []
if len(list) == n:
# when list has been dwindeled down to size n
# check to see if the combo has already been found
# if not, add it to our list
if combos.count(list) == 0:
@nivir
nivir / CMakeLists.txt
Created June 27, 2018 17:58 — forked from UnaNancyOwen/CMakeLists.txt
Drawing Point Cloud retrieve from Velodyne VLP-16
cmake_minimum_required( VERSION 2.8 )
# Create Project
project( solution )
add_executable( project main.cpp )
# Set StartUp Project (Option)
# (This setting is able to enable by using CMake 3.6.0 RC1 or later.)
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
@nivir
nivir / git-change-commit-messages.md
Created January 1, 2018 22:53 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.