Skip to content

Instantly share code, notes, and snippets.

View marsicdev's full-sized avatar
🏠
Working from home

Marko Arsić marsicdev

🏠
Working from home
View GitHub Profile
{
"meta": {
"limit": 10,
"next": null,
"offset": 0,
"previous": null,
"total_count": 1
},
"drivers": [
{
@marsicdev
marsicdev / app.js
Created October 31, 2017 21:30
Movie list full application with modules example
var dataController = (function () {
var data = {
movies: [],
totalMoviesLength: 0
};
// Movie constructor
function Movie(title, length, genre) {
this.title = title;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Movie list</title>
<link rel="stylesheet" href="./css/main.css">
</head>
<body>
'use strict';
/**
* Represents person
* @constructor
* @param {string} name - First name
* @param {string} surname - Last name
*/
function Person(name, surname) {
this.name = name;
@marsicdev
marsicdev / entities.js
Created October 26, 2017 15:01
Movie form example
function Movie(title, length, genre) {
this.title = title;
this.length = length;
this.genre = genre;
}
Movie.prototype.getInfo = function () {
return this.title + ", " + this.genre;
};
'use strict';
/**
* Represent movie genre
* @constructor
* @param {string} genreName - The genre name
*/
function Genre(genreName) {
// properties
this.name = genreName;
var school = {
name: "BIT",
address: "Nemanjina 4",
city: "Belgrade",
isOpen: true,
teachers: ["Marko", "Nenad", "Stanko"],
students: ["Pera", "Mika", "Zika"]
}
var speaker = {
// In our example, the first function, multiplyByTwo(),
// accepts three parameters, loops through them,
// multiplies them by two, and returns an array
// containing the result.
function multiplyByTwo(a, b, c) {
var outputArray = [];
for (var i = 0; i < arguments.length; i++) {
var currentElement = arguments[i];
import java.util.*
fun main(args: Array<String>) {
println("Say hello to Kotlin".withUnderscore())
// ----- VARIABLES -----
@marsicdev
marsicdev / app-build.gradle
Created May 4, 2017 14:08
Starter Android app gradle files (kotlin)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
def BOOLEAN = "boolean"
def STRING = "String"
def TRUE = "true"
def FALSE = "false"
def LOG_HTTP_REQUESTS = "LOG_HTTP_REQUESTS"