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
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
// 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
# 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
// 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
// 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
<?php | |
$a = 2; | |
$b = 2; | |
$c = 1; | |
$d = 1; | |
$e = 3; | |
$f = 3; |
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
<?php | |
$a = 5; | |
$b = 5; | |
for ($aa = 0; $aa <= $a; $aa++) | |
{ | |
for ($bb = 0; $bb <= $b; $bb++) | |
{ | |
if ($aa == 0 || $bb == 0) |
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
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
class test | |
{ | |
public static void Main(String[] args) | |
{ | |
string hostName = "india.colorado.edu"; | |
int hostPort = 13; |
OlderNewer