This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Config.h" | |
int8_t Config_Init(const uint8_t* const filename) { | |
int i; | |
char line[CONFIG_MAX_LINE_LENGTH]; | |
FILE* file; | |
keys = (uint8_t**)malloc(sizeof(uint8_t*)); | |
values = (uint8_t**)malloc(sizeof(uint8_t*)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <inttypes.h> | |
#include <string.h> | |
#include <assert.h> | |
uint8_t time2string(char* result, uint64_t time) { | |
// Calculate time | |
uint8_t mm_prim = ((time & 0x000000FF00) >> 8); | |
uint8_t ss_prim = (time & 0x00000000FF); | |
uint8_t hh_prim = ((time & 0x0000FF0000) >> 16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use `sudo docker build .` to run it | |
FROM ros | |
RUN apt-get update | |
RUN apt-get install -y curl | |
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash | |
RUN apt-get install -y nodejs | |
RUN apt-get install -y git | |
RUN git clone https://github.com/Memristor-Robotics/mep-master.git --depth 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Use following command to run the script: | |
# $ curl https://gist.githubusercontent.com/lukicdarkoo/3ff2af3f739ee8ead98da950747a3db9/raw/a998c45fde127ee58808f55db3cd53b6ceded88d/music.sh | sh | |
# | |
# Created by Darko Lukic <[email protected]> | |
DEVICE=/dev/sdb | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The script allows fast performance comparison of Node.js interpreter (different version on different architectures). | |
* `curl https://gist.githubusercontent.com/lukicdarkoo/810dcac696ddd6fcc956fb6a5fdd9693/raw | node` | |
*/ | |
// Functions | |
function calc(val) { | |
return { | |
'cos': Math.cos(val), | |
'sin': Math.sin(val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage `curl https://gist.githubusercontent.com/lukicdarkoo/1a448da0903e0a21fc77979b9e24c3b9/raw/99ae53ef92c4c1ca85e0e992e7b62098f74036b1/kinetic-ubuntu.sh | sh` | |
# Make ROS packages available | |
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | |
wget http://packages.ros.org/ros.key -O - | sudo apt-key add - | |
sudo apt update | |
# Install ROS | |
sudo apt install -y ros-kinetic-desktop-full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Starts a YouTube video only when it is visible on screen. If user stops the video | |
* it will not be played again. | |
* | |
* @example | |
* <iframe id="video-intro" width="100%" height="380px" src="https://www.youtube.com/embed/ZyOuAHrKX2c?rel=0&controls=0&showinfo=0&enablejsapi=1" frameborder="0"></iframe> | |
* <script> | |
* new SmartVideoPlayer('video-intro'); | |
* </script> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let startTime = process.hrtime(); | |
if (centerPoint.getDistance(Mep.Position.getPosition()) < this.config.hazardObstacleDistance) { | |
let target = this._targetQueue.getTargetBack(); | |
if (target !== null) { | |
let line = new Line(Mep.Position.getPosition(), target.getPoint()); | |
if (line.isIntersectWithPolygon(polygon) === true) { | |
// this.emit('pathObstacleDetected', true); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: curl https://gist.githubusercontent.com/lukicdarkoo/e33e00c6780ad0215d3932b810a10e46/raw | sh | |
echo "In case of any issues please consult cosmicpi.org for help, or contact us via Facebook " | |
echo "--- Expand the file system ---" | |
sudo resize2fs /dev/mmcblk0p2 | |
echo "--- Update OS ---" | |
sudo apt -y update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# The script configures simultaneous AP and Managed Mode Wifi on Raspberry Pi Zero W (should also work on Raspberry Pi 3) | |
# Usage: curl https://gist.githubusercontent.com/lukicdarkoo/6b92d182d37d0a10400060d8344f86e4/raw | sh -s WifiSSID WifiPass APSSID APPass | |
# Licence: GPLv3 | |
# Author: Darko Lukic <[email protected]> | |
# Special thanks to: https://albeec13.github.io/2017/09/26/raspberry-pi-zero-w-simultaneous-ap-and-managed-mode-wifi/ | |
MAC_ADDRESS="$(cat /sys/class/net/wlan0/address)" | |
CLIENT_SSID="${1}" | |
CLIENT_PASSPHRASE="${2}" |