Skip to content

Instantly share code, notes, and snippets.

View lectroidmarc's full-sized avatar

Marc Matteo lectroidmarc

View GitHub Profile
@lectroidmarc
lectroidmarc / profile.bash
Created September 15, 2014 20:59
Shows how to set up a colorized git prompt
source ~/.git-completion.bash
source ~/.git-prompt.sh
#PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
PS1='[\u@\h \W$(__git_ps1 " (\[\e[0;33m\]%s\[\e[0m\])")]\$ '
@lectroidmarc
lectroidmarc / freeram.ino
Last active August 29, 2015 14:06
Show free SRAM on an Arduino.
void setup () {
Serial.begin(9600);
}
void loop () {
Serial.println(freeRam());
delay(1000);
}
int freeRam () {
@lectroidmarc
lectroidmarc / SoftwareSerial.patch
Created September 4, 2014 17:11
Arduino 256 byte Software Serial buffer.
--- libraries/SoftwareSerial/SoftwareSerial.h.orig 2014-09-04 08:52:10.000000000 -0700
+++ libraries/SoftwareSerial/SoftwareSerial.h 2014-09-04 08:52:59.000000000 -0700
@@ -39,7 +39,7 @@
* Definitions
******************************************************************************/
-#define _SS_MAX_RX_BUFF 64 // RX buffer size
@lectroidmarc
lectroidmarc / HardwareSerial.patch
Last active August 29, 2015 14:06
Arduino 256 byte hardware serial buffer
--- hardware/arduino/cores/arduino/HardwareSerial.cpp.orig 2014-09-04 08:58:24.000000000 -0700
+++ hardware/arduino/cores/arduino/HardwareSerial.cpp 2014-09-04 08:59:10.000000000 -0700
@@ -56,7 +56,7 @@
#if (RAMEND < 1000)
#define SERIAL_BUFFER_SIZE 16
#else
- #define SERIAL_BUFFER_SIZE 64
+ #define SERIAL_BUFFER_SIZE 256
#endif
/**
* Implement JSONP
* @param {string} url The URL to call.
* @param {function} callback A callback function, called with a single data parameter.
*/
function jsonp(url, callback) {
var callbackName = 'callback_' + Math.round(100000 * Math.random());
window[callbackName] = function(data) {
@lectroidmarc
lectroidmarc / git-pulldirs.sh
Last active August 29, 2015 14:03
Recursive 'git pull'.
#!/bin/sh
RUN_DIR=`pwd`;
find . -type d -name .git -print0 \
| xargs -0 -I{} dirname {} \
| sort \
| while read line; do echo "\033[1m$line\033[0m" && cd "$line" && git pull; cd "$RUN_DIR"; done