Skip to content

Instantly share code, notes, and snippets.

View holachek's full-sized avatar

Michael holachek

View GitHub Profile
@holachek
holachek / Gemfile
Created December 27, 2011 16:43
Gemfile of sample app. Command to run rspec tests doesn't work.
source 'http://rubygems.org'
gem "rails", "~> 3.1.0"
gem 'sqlite3', '1.3.3'
group :development do
gem 'rspec-rails'
end
group :test do
@holachek
holachek / nginx.conf
Created December 31, 2011 04:11
PHP doesn't work using this nginx.conf file
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@holachek
holachek / rsync_backup.sh
Created January 16, 2012 12:48
rysnc incrementally copies specified local folder and mySQL database to a remote server
#!/bin/bash
#: Title : rsync backup to remote server
#: Date : 2012-01-16
#: Author : mh
#: Version : 1.0
#: Description : Incremental rsync backup of mySQL database and given path
# to a remote server. Run this script on the machine that
# has the files you want to backup to a remote server.
#: Options : Set the local/remote directory, backup folder name
#include <Wire.h>
#define DEVICE (0x53) //ADXL345 device address
#define TO_READ (6) //num of bytes we are going to read each time (two bytes for each axis)
byte buff[TO_READ] ; //6 bytes buffer for saving data read from the device
char str[512]; //string buffer to transform data before sending it to the serial port
void setup()
{
import processing.opengl.*;
import processing.serial.*;
Serial sp;
byte[] buff;
float[] r;
int SIZE = 150, SIZEX = 200;
int OFFSET_X = -28, OFFSET_Y = 9; //These offsets are chip specific, and vary. Play with them to get the best ones for you
@holachek
holachek / Makefile
Created August 7, 2012 01:51
AVR Tutorial Makefile
# Name: Makefile
# Author: <insert your name here>
# Copyright: <insert your copyright message here>
# License: <insert your license reference here>
# This is a prototype Makefile. Modify it according to your needs.
# You should at least check the settings for
# DEVICE ....... The AVR device you compile for
# CLOCK ........ Target AVR clock rate in Hertz
# OBJECTS ...... The object files created from your source files. This list is
@holachek
holachek / main.c
Created August 7, 2012 01:58
AVR Tutorial main.c
#include <avr/io.h>
int main (void)
{
DDRD |= (1 << PD6);
for(;;)
{
PORTD |= (1 << PD6);
}
return 0;
@holachek
holachek / main.c
Created August 8, 2012 20:10
AVR Tutorial main.c
#include <avr/io.h>
#include <util/delay.h>
int main (void)
{
DDRD |= (1 << PD6);
for(;;)
{
PORTD ^= (1 << PD6);
_delay_ms(100);
}
@holachek
holachek / main.c
Last active September 8, 2021 11:29
AVR Tutorial main.c
#define F_CPU 1000000 // CPU frequency for proper time calculation in delay function
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRD |= (1 << PD6); // make PD6 an output
for(;;)
@holachek
holachek / Makefile
Created August 9, 2012 14:53
AVR Tutorial Makefile
# Name: Makefile
# Author: <insert your name here>
# Copyright: <insert your copyright message here>
# License: <insert your license reference here>
# DEVICE ....... The AVR device you compile for
# CLOCK ........ Target AVR clock rate in Hertz
# OBJECTS ...... The object files created from your source files. This list is
# usually the same as the list of source files with suffix ".o".
# PROGRAMMER ... Options to avrdude which define the hardware you use for