Skip to content

Instantly share code, notes, and snippets.

View VojislavM's full-sized avatar
🔌
Live

Vojislav Milivojevic VojislavM

🔌
Live
View GitHub Profile
@VojislavM
VojislavM / python_master.sh
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…
#!/bin/bash
#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
py2=../python.exe
py2_n=../python2.exe
#python3 path
py3=../python.exe
py3_n=../python3.exe
@VojislavM
VojislavM / python_master.sh
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
#!/bin/bash
#python2 path
py2=v2/v.txt
#C:/Python27/python.exe
#python3 path
py3=v3/v.txt
#C:/Users/vojislav/AppData/Local/Programs/Python/Python38-32/python.exe
VERSION=$1
@VojislavM
VojislavM / HowToOTGFast.md
Last active May 13, 2017 15:52 — forked from gbaman/HowToOTGFast.md
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 - http://blog.gbaman.info/?p=791

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
VojislavM / .travis.yml
Last active May 23, 2017 12:05
Travis CI ".travis.yml" config file for ESP8266 and Arduino IDE
language: c
env:
- BD=esp8266:esp8266:nodemcuv2:CpuFrequency=80,FlashSize=4M3M
before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget http://downloads.arduino.cc/arduino-1.8.2-linux64.tar.xz
- tar xf arduino-1.8.2-linux64.tar.xz
- sudo mv arduino-1.8.2 /usr/local/share/arduino
@VojislavM
VojislavM / .gitignore
Created March 9, 2017 08:52
gitignore file for Altium PCB project
project_file/History/*
project_file/__Previews/*
project_file/Project Logs for project_file/*
@VojislavM
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
VojislavM / play with bits.md
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
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
#!/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.