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
// Energia sketch to test a light sensor connected to an operational amplifier. The circuit | |
// is powered by enabling the P1.6 signal during TEST_MILLIS every EVERY_MILLIS in | |
// order to safe energy (TEST_MILLIS/EVERY_MILLIS fraction). | |
#define POWER_LED GREEN_LED /* green LED (LED2 on board) and P1.6 connected to the Vdd */ | |
#define SENSOR_LED RED_LED /* red LED (LED1 on board) */ | |
#define SENSOR P1_7 /* pin P1.7 connected to Vout of the operational amplifier */ | |
#define TEST_MILLIS 1 /* milliseconds that test is enabled */ | |
#define EVERY_MILLIS 1000 /* milliseconds of the period of test */ |
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
// compile: mono-csc Threads.cs | |
// execute: mono Threads.exe | |
using System; | |
using System.Threading; | |
namespace Test | |
{ | |
class Threads |
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
# git prompt | |
function git-branch-name { | |
git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3 | |
} | |
function git-branch-prompt { | |
local branch=`git-branch-name` | |
if [ $branch ]; then printf " [%s]" $branch; fi | |
} |
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
// crc16.c | |
#include "crc16.h" | |
static const uint16_t ccitt_hash[] = { | |
0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7, | |
0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef, | |
0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6, | |
0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de, | |
0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485, |
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
void setup() { | |
Serial.begin(9600); // Arduino monitor | |
Serial1.begin(9600); // connected UART | |
} | |
void loop() { | |
while (true) { | |
while (Serial.available()) Serial1.write(Serial.read()); | |
while (Serial1.available()) Serial.write(Serial1.read()); | |
delay(10); |
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
# Fix the TERM variable to allow 256 colors in a gnome-terminal. Pretty full color in vim! | |
# Put this lines in your ~/.bashrc | |
if [ "$TERM" == "xterm" ] && [ "$COLORTERM" == "gnome-terminal" ]; then | |
export TERM=xterm-256color | |
fi |
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
" general | |
set nocompatible | |
set number | |
set ruler | |
set textwidth=78 | |
set nowrap | |
set colorcolumn=+3,+43 | |
set encoding=utf-8 | |
set fileformats=unix,dos,mac | |
set history=100 |
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
package net.treboada.mytests.fragments; | |
public class TestXmlFragment01 extends XmlFragment { | |
// ... | |
} |
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
package net.treboada.mytests.fragments; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.util.AttributeSet; | |
public class XmlFragment extends android.support.v4.app.Fragment { | |
@Override | |
public void onInflate(Activity activity, AttributeSet attrs, |
NewerOlder