Skip to content

Instantly share code, notes, and snippets.

@hanvari
hanvari / track_upstream_changes.md
Last active October 4, 2017 20:33
Tracking Upstream changes for scripts with local customizations
  1. Setup:
git clone <repo-url>
git branch -m master vendor
#check configurations
git config --get-regexp 'branch.vendor.*'
#master will contain customizations
git checkout -b master
@hanvari
hanvari / phonegap-gitignore
Created February 12, 2018 22:55
Phonegap Project .gitignore file
# ANDROID / ECLIPSE
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
@hanvari
hanvari / README.md
Created March 1, 2018 19:06
How to Bootcamp / Dual Boot Windows 10 on a mid-2011 iMac using USB

How to Install / Bootcamp Windows 10 on a mid-2011 iMac using USB

Apple has released support for bootcamping Windows 10, but only on 2012 Macs and later. Despite not being supported. it is possible to install Windows 10 on earlier iMacs and it seems to run quite well.

IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.

RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.

Requirements

@hanvari
hanvari / jupyter_shortcuts.md
Last active April 13, 2018 19:43 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

A Better version:

https://www.cheatography.com/weidadeyue/cheat-sheets/jupyter-notebook/

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

@hanvari
hanvari / python-histogram.md
Last active March 13, 2022 20:06
Plotting Histogram In Python

Plotting Histograms in Python

Using MatPlotLib API

Example 1:

s = np.random.uniform(-1,0,1000)
import matplotlib.pyplot as plt
count, bins, ignored = plt.hist(s, 15, normed=True)
plt.plot(bins, np.ones_like(bins), linewidth=2, color='r')
@hanvari
hanvari / python-string-formatting.md
Last active June 9, 2020 05:55
String Formatting & Substitution in Python

String Formatting & Substitution in Python

Method-1

data = {'unit': 'celsius', 'value':20}
"The temperature in %(unit)s is %(value)f degrees" % data

Method-2

@hanvari
hanvari / macos-iso-bootable.md
Created June 1, 2018 09:10
Create Bootable USB from ISO file in MacOS

Create Bootable USB stick form ISO in MacOS

Convert ISO to UDRW format

$ hdiutil convert -format UDRW -o destination_file.img source_file.iso

Prepare USB stick

  1. Find usb stick device file
$ diskutil list
@hanvari
hanvari / vim-tricks.md
Last active June 8, 2020 18:50
VI / VIM Editor Commands, Configuration, Tricks
@hanvari
hanvari / mysqldump-tips.md
Last active February 12, 2021 07:03
mysqldump helpful tips for export/import

mysqldump Tips

CLI command format

$ mysqldump <mysqldump options> [<dbname1> <dbname2> ...] [> outputfile.sql]

CLI Options

  • --all-databases