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
hardstatus alwayslastline "%{b}[%{B}%H%{b}][%{k}%?%-Lw%?%{b}(%{R}%n %t%?(%u)%?%{b})%{k}%?%+Lw%?%?%= %{b}][%{B}%d/%m %{k}%C%{b}]" | |
msgwait 1 | |
vbell off | |
shell "/bin/bash" | |
scrollback 3000 |
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
#include<fstream> | |
#include<iostream> | |
int main(int argc, char* argv[]) { | |
std::cout << "sizeof(unsigned int)" << sizeof(unsigned int) << std::endl; | |
std::cout << "sizeof(double)" << sizeof(double) << std::endl; | |
if (argc < 2) return -1; |
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
import struct | |
import sys | |
def main(): | |
print 'file:', sys.argv[1] | |
with open(sys.argv[1], 'r') as dat_file: | |
print 'count:', struct.unpack('=I', dat_file.read(4)) |
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
int ledPins[] = {2,3,4,5,6,7,8,9}; | |
int ledCount = 8; | |
void setup() { | |
for (int i = 0; i < ledCount; i++) | |
pinMode(ledPins[i], OUTPUT); | |
} | |
void loop() { | |
oneAfterAnotherNoLoop(); |
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
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/Vundle.vim' |
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
/* --------------------------------------------------------- | |
* | Arduino Experimentation Kit Example Code | | |
* | CIRC-05 .: 8 More LEDs :. (74HC595 Shift Register) | | |
* --------------------------------------------------------- | |
* | |
* We have already controlled 8 LEDs however this does it in a slightly | |
* different manner. Rather than using 8 pins we will use just three | |
* and an additional chip. | |
* | |
* |
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
hardstatus alwayslastline "%{b}[%{B}%H%{b}][%{k}%?%-Lw%?%{b}(%{R}%n %t%?(%u)%?%{b})%{k}%?%+Lw%?%?%= %{b}][%{B}%d/%m %{k}%C%{b}]" | |
msgwait 1 | |
vbell off | |
scrollback 3000 |
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
#!/usr/bin/python | |
# | |
# Backs up the files/folders according to the configuration in config.json. Will | |
# send an reporting the success or failure of the rsyncs. | |
import json, os, smtplib, ast, datetime | |
from email.mime.text import MIMEText | |
def email_backup_failures(config, failed_backups, failed = True): | |
# build message body |
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
{ | |
"backup_sources": [ | |
"/home/username/Documents", | |
"/home/username/Mail" | |
], | |
"rsync_excludes": "", | |
"backup_server_location": "/mnt/backup", | |
"log_file": "log/backup.log", | |
"log_file_path_relative": true, |
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
function msnow() | |
t = time() | |
tm = Libc.TmStruct(t) | |
DateTime(tm.year+1900,tm.month+1,tm.mday,tm.hour,tm.min,tm.sec,round(Int64,t*1000)%1000) | |
end |