Skip to content

Instantly share code, notes, and snippets.

View MPieter's full-sized avatar

Pieter Meiresone MPieter

View GitHub Profile
@stevecondylios
stevecondylios / install-r-and-rstudio-on-windows-with-powershell
Last active December 17, 2019 01:22
Powershell script to install both R and RStudio on Windows. NOTE: there are a couple of links in the script below - update them to ensure you install most recent versions
$dir = $env:TEMP;
Set-Location $dir
$urlRStudio = "https://download1.rstudio.org/desktop/windows/RStudio-1.2.1335.exe"
$outputRStudio = "$dir\RStudio.exe"
$wcRStudio = New-Object System.Net.WebClient
$wcRStudio.DownloadFile($urlRStudio, $outputRStudio) # $PSScriptRoot
$urlR = "https://cran.r-project.org/bin/windows/base/R-3.6.0-win.exe"
@shubh-agrawal
shubh-agrawal / rotationMat2Quaternion.cpp
Last active October 25, 2023 13:59
OpenCV lacks a conversion function from rotation matrix to quaternion. In ROS applications, the rotation of a robot or link is generally described by 4 quaternion numbers. Some people might say that you have "tf" for all such transformations, but it requires your data to be of specific datatype. Here is a small function, that converts opencv Mat…
void getQuaternion(Mat R, double Q[])
{
double trace = R.at<double>(0,0) + R.at<double>(1,1) + R.at<double>(2,2);
if (trace > 0.0)
{
double s = sqrt(trace + 1.0);
Q[3] = (s * 0.5);
s = 0.5 / s;
Q[0] = ((R.at<double>(2,1) - R.at<double>(1,2)) * s);
@superjax
superjax / occupancy_grid_mapping_example.py
Last active May 23, 2024 05:29
An occupancy grid mapping example
# This is an implementation of Occupancy Grid Mapping as Presented
# in Chapter 9 of "Probabilistic Robotics" By Sebastian Thrun et al.
# In particular, this is an implementation of Table 9.1 and 9.2
import scipy.io
import scipy.stats
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
@wesbos
wesbos / gulpfile.js
Last active October 21, 2019 19:38
FAST Browserify + Reactify + Babelify
// Update: Hey Folks - I've got a full Gulpfile with everything else over at https://github.com/wesbos/React-For-Beginners-Starter-Files
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var babelify = require('babelify');
var watchify = require('watchify');
var notify = require('gulp-notify');
@nicolashery
nicolashery / gulpfile-react-jshint.js
Created October 20, 2014 17:06
Gulpfile for JSHint on a React app with watch, JSX error logging, and cache
var gulp = require('gulp');
var react = require('gulp-react');
var jshint = require('gulp-jshint');
var cache = require('gulp-cached');
var jsFiles = [
'src/**/*.js',
'test/**/*.js',
'*.js'
];
@simenbrekken
simenbrekken / gulpfile.js
Created March 14, 2014 08:54
React project gulpfile
var gulp = require('gulp'),
gutil = require('gulp-util')
// HTML
gulp.task('html', function() {
return gulp.src('src/index.html')
.pipe(gulp.dest('build'))
})
// Scripts
@jeffcollier
jeffcollier / SaveIconsForiOSIcons.jsx
Last active August 28, 2023 09:17 — forked from jeremieweldin/SaveIconsForiOSIcons.jsx
Adobe Illustrator automation script for exporting an icon artboard to all the sizes needed for iOS apps. [I upgraded this hyper-helpful script from Jeremie Weldin for iOS 7 images sizes. To apply, open your icon file in Illustrator, select File | Scripts | Others..., and browser to the directory containing this file. -Jeff]
var destFolder = null;
destFolder = Folder.selectDialog( 'Select the folder where you want to save the exported files.', app.activeDocument.path );
var baseDestName = app.activeDocument.name;
if (baseDestName.indexOf('.') < 0)
{
//nothing
} else {
var dot = baseDestName.lastIndexOf('.');
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {