Skip to content

Instantly share code, notes, and snippets.

View peterwallhead's full-sized avatar
👨‍💻
Currently focusing on ROS 2 & SLAM.

Peter Wallhead peterwallhead

👨‍💻
Currently focusing on ROS 2 & SLAM.
View GitHub Profile
@arisetyo
arisetyo / index.html
Created July 12, 2013 16:37
Dynamic Real-time Chart Using Chart.js, Socket.io, and Knockout.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Galenic">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/knockout-2.1.0.js"></script>
<script src="js/Chart.js"></script>
<link rel="stylesheet" href="pure-min.css">
@nodesocket
nodesocket / bootstrap.flatten.css
Last active October 20, 2025 11:48
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@mnbbrown
mnbbrown / README.md
Last active December 18, 2015 13:59
Go implementation of a JSON consuming RESTful API.

The following is a very barebones PoC implementation of a somewhat RESTful (more CRUD) API that consumes JSON. It's a WIP.

The GenUUID function is based upon nu7hatch's implementation: https://github.com/nu7hatch/gouuid

Things to improve:

  • Error and panic handling/recovery including the JSON marshalling of errors.
  • Persistance & Concurrency Locks
  • Logging
@tfeldmann
tfeldmann / i2c_scanner.ino
Created April 18, 2013 09:13
A I2C Scanner for Arduino
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not known.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
# This is a really old post, in the comments (and stackoverflow too) you'll find better solutions.
def find(key, dictionary):
for k, v in dictionary.iteritems():
if k == key:
yield v
elif isinstance(v, dict):
for result in find(key, v):
yield result
elif isinstance(v, list):
@zaus
zaus / FormRepo.js
Last active July 5, 2025 10:37
Preserve form values across page loads -- i.e. persistent forms. Uses `localStorage` to persist, `jQuery` for utilities.
var FormRepo = function (namespace) {
/// <summary>Persistent form values, saves to localStorage</summary>
/// <param name="namespace" type="String">the namespace to store values in localStorage</param>
// should also protect per page, since we could have the same forms in various places
this.N = namespace + '.' + window.location.pathname;
};
$.extend(FormRepo.prototype, {
namespace: function (key) {
return this.N + '.' + key;
@ndarville
ndarville / business-models.md
Last active January 3, 2026 06:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@zacharyvoase
zacharyvoase / curlwhat.py
Created November 13, 2012 18:22
Use curl to make requests from Python. License: http://unlicense.org/
"""
>>> response = curl('http://news.ycombinator.com/')
>>> response.status
200
>>> response.getheader('content-type')
'text/html; charset=utf-8'
>>> response.read(6)
'<html>'
>>> response.close()
"""
@NickJosevski
NickJosevski / guids.md
Last active September 18, 2017 00:35
Used Guids, share the love.

Used Guid Reporting

Ever wondered if that that GUID you're about to use has already been consumed?

No.

Well you should. Check the twitter feed - twitter.com/UsedGuid, and start reporting your usage of GUIDs. It's the right thing to do.

Throw away those old paper based systems.

@lucasvo
lucasvo / test_helpers.py
Created October 26, 2012 22:01
Flask Unit Test Helpers
import json as jsonlib
def response_success(response, code=200):
if 200 <= code < 300:
assert 200 <= response.status_code < 300
assert code == response.status_code
def response_error(response, code=400):
if 400 <= code < 500:
assert 400 <= response.status_code < 500