Skip to content

Instantly share code, notes, and snippets.

View VojislavM's full-sized avatar

Vojislav Milivojevic VojislavM

View GitHub Profile
VojislavM /
Last active December 13, 2019 09:19
When using two version of the python (2 and 3) on windows 10 and you need to make one of the versions "main" version. By main version I mean when you call "python" in cmd your main version will open. To run this script you need some kind of "linux on windows" system, like MinGW. To add both pythons to your windows PC you can follow this tutorial h…
#change the dots with your python 2 and 3 paths and leave .exe file names as they are, you can find them in windows env variables
#python2 path
#python3 path
VojislavM /
Created December 12, 2019 17:22
When using two version of the python (2 and 3) on windows 10 and you need to make one of the versions "main" version. By main version I mean when you call "python" in cmd your main version will open
#python2 path
#python3 path
VojislavM /
Last active May 13, 2017 15:52 — forked from gbaman/
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details -

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH is

VojislavM / .travis.yml
Last active May 23, 2017 12:05
Travis CI ".travis.yml" config file for ESP8266 and Arduino IDE
language: c
- BD=esp8266:esp8266:nodemcuv2:CpuFrequency=80,FlashSize=4M3M
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/ --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget
- tar xf arduino-1.8.2-linux64.tar.xz
- sudo mv arduino-1.8.2 /usr/local/share/arduino
VojislavM / .gitignore
Created March 9, 2017 08:52
gitignore file for Altium PCB project
project_file/Project Logs for project_file/*
VojislavM / degrees-radians.h
Created September 27, 2016 12:21 — forked from dbrockman/degrees-radians.h
Convert degrees <-> radians C macros
// Converts degrees to radians.
#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0)
// Converts radians to degrees.
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / M_PI)
VojislavM / play with
Last active August 28, 2017 13:59
Different bit operation in C

Setting a bit

Use the bitwise OR operator (|) to set a bit.

number |= 1 << x;

That will set bit x.

Clearing a bit

VojislavM / git.migrate
Created March 31, 2016 13:55 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
# 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.