Skip to content

Instantly share code, notes, and snippets.

View draganmarjanovic's full-sized avatar

Dragan Marjanovic draganmarjanovic

View GitHub Profile
@draganmarjanovic
draganmarjanovic / main.ino
Created May 31, 2015 14:51
Blackbox Detection Craft
// The University of Queensland
// Engineering - ENGG1100
// White Team
// Year: 2015
// Author: Dragan Marjanovic
// Libraries and Headers
#include <Servo.h>
#include <Wire.h> //I2C Arduino Library
@draganmarjanovic
draganmarjanovic / time_casualty.json
Last active August 29, 2015 14:24
Data structure for passing of hour / casualty information. Sum of fatality counts should be 100 and time is given in 24hr time 0-24.
{
"description": "[{str(time),int(casualties)}]",
"data": [
{
"time": 01,
"fatality_count": 25
},
{
"time": 02,
"fatality_count": 25
@draganmarjanovic
draganmarjanovic / videoconv.py
Last active November 24, 2015 12:58
Convert any supported video file type to MP4.
#!/usr/bin/python
import os
from os import listdir
from os.path import isfile, join
# Preferences
supported_formats = ["mkv", "mp4", "wmv", "flv", "m4v"]
output_format = "mp4"
@draganmarjanovic
draganmarjanovic / poylmer-element-import.py
Last active February 16, 2016 21:15
The script scans the current directory for polymer elements and then automatically generates a master import file - to save the user time.
# README
# How to use:
# This script creates a file called 'element-import.html' which is filled with
# the polymer import statements automatically from the folders in the directory
# from which this script is run.
# Import OS to allow reading of directories
import os
# Gets list of folders within the current directory
# Name: Makefile
# Author: Dragan Marjanovic
# Based on https://github.com/obdev/CrossPack-AVR/
DEVICE = atmega324a
CLOCK = 8000000
PROGRAMMER = -c avrispmkii
OBJECTS = project.o
AVRDUDE = avrdude $(PROGRAMMER) -p m324pa -F -B10
COMPILE = avr-gcc -Wall -Os -std=gnu99 -DF_CPU=$(CLOCK) -mmcu=$(DEVICE)
# Colours
maincolour="%{$fg_bold[white]%}"
altcolour="%{$fg[green]%}"
gitcolour="%{$fg[yellow]%}"
resetcolour="%{$reset_color%}"
usercolour="" #"%{fg[blue]%}"
hostcolour="%{$fg[blue]%}"
function prompt_hostname()
{
@draganmarjanovic
draganmarjanovic / string_exercises.c
Created July 24, 2016 09:11
C String Exercises
//Ex.4 - Write a function that reads a line of any length from a file and
//returns it as a string.
#include <stdio.h>
#include <stdlib.h>
/*
* Counts the length of NUL terminated
* character array.
" Vundle Stuff
set nocompatible
filetype off
set rtp+=~/.config/nvim/bundle/Vundle.vim
" Plugins
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' " Vundle
Plugin 'airblade/vim-gitgutter'
Plugin 'mattn/gist-vim' " Create Gists
import graphviz as gv
tree = [54, 26, 15, 93, 8, 1, 23, 39];
def left_child(index, length):
child = (index * 2 + 1)
if (child <= length - 1):
return child
else:
return -1

Keybase proof

I hereby claim:

  • I am draganmarjanovic on github.
  • I am dmarj97 (https://keybase.io/dmarj97) on keybase.
  • I have a public key ASC26IYsFZYjsMGJI8ndv1auJpv9NEc-oGVeeQy6cDdJDQo

To claim this, I am signing this object: