Skip to content

Instantly share code, notes, and snippets.

@richard-flosi
richard-flosi / trilateration.js
Last active September 23, 2024 00:13
JavaScript Trilateration
// Created by Derrick Cohodas (dav-)
// Based on the Python example by StackExchange user wwnick from http://gis.stackexchange.com/a/415/41129
// Requires the Mathjs library - http://mathjs.org/
var math = require('mathjs')
/**
* Represents a coordinate with a distance
* @param {Number} lat Latitude
@jmtatsch
jmtatsch / setup.sh
Last active March 15, 2017 13:00 — forked from mikepurvis/gist:9837958
Install ROS Jade on OS X El Capitan
# NOTE: These instructions do not represent a robust, self-troubleshooting install; they
# are definitely not suitable for dumping to a giant script and running as one. If you
# use them, they should be run one at a time, with an eye out for errors or problems
# along the way.
#
# The #1 issue you are likely to encounter is with Homebrew or Python packages whose
# binary components link against system Python. This will result in runtime segfaults,
# especially in rviz. If you suspect this is occurring, you can attempt to remove and
# reinstall the offending packages, or go for the nuclear option--- empty your Cellar
# and site-packages folders and start over with brewed python from the beginning.
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@soheilhy
soheilhy / nginxproxy.md
Last active September 19, 2024 06:16
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

anonymous
anonymous / gist:9565349
Created March 15, 2014 11:11
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
// BASIC SETTINGS: select your board type, thermistor type, axis scaling, and endstop configuration
//// The following define selects which electronics board you have. Please choose the one that matches your setup
// MEGA/RAMPS up to 1.2 = 3,
// RAMPS 1.3/1.4 = 33
// Gen6 = 5,
// Gen6 deluxe = 51
@glennschler
glennschler / Notes.md
Last active March 25, 2022 02:39
Raspberry Pi Notes

Notes

Install of Wheezy-Raspbian v2013-09-25

Configure Raspberry Pi from Mac OS X

  • Download Raspbian Raw image
  • From the OS X command line. Following these eLinux SD Card Setup. To summarize:
    • diskutil list
      • identify the disk (not partition) of your SD card. e.g. disk4 (not disk4s1)
    • diskutil unmountDisk /dev/<disk# from diskutil>
  • e.g. diskutil unmountDisk /dev/disk3
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@mikermcneil
mikermcneil / using-raw-socket-io-in-sails.js
Created September 17, 2013 18:32
Using raw socket.io functionality in a Sails.js controller
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
@southwolf
southwolf / Pebble.ino
Last active January 26, 2020 20:40
Arduino code for Communicate with Pebble
#include <string.h>
#include <ctype.h>
#include <SoftwareSerial.h>
// the Bluetooth Shield connects to Pin D9 & D10
SoftwareSerial bt(9,10);
const uint8_t req[5] = {0x00, 0x01, 0x00, 0x11, 0x00};
const uint8_t cap[17] = {0x00, 0x0d, 0x00, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32};
const uint8_t ping[9] = {0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef};
@nazt
nazt / spreadsheet.js
Last active October 13, 2015 14:47 — forked from anonymous/gist:4211625
var bag = []
function get_data (worksheet_id, cb) {
var sorted;
var local = { };
console.log('processing', worksheet_id)
jQuery.getJSON("http://localhost:5000/?callback=?&spreadsheet_key=0Av03mDBecdQEdEpaQkt3U0ktTGJYajNSLWR1SVNXbkE&&worksheet_key="+worksheet_id, function(v, k) {
local['data'] = v
bag.push(v['data']);
cb(null)
})