Skip to content

Instantly share code, notes, and snippets.

View tedhagos's full-sized avatar

Ted Hagos tedhagos

View GitHub Profile
@tedhagos
tedhagos / install-steps-gnu-health
Created January 2, 2012 03:07
Installation notes for GNU Health
1. Make sure you have the following requisites
- Debian or Ubuntu
- Postgresql
- Python
- Tryton
2. Install requisite software
2.1 apt-get install python-pip python-lxml python-relatorio python-psycopg2 posgresql python-tz
@tedhagos
tedhagos / test_mysql.sql
Created April 1, 2012 13:57
MySQL test table creation script
/*
@date Sun Apr 1 21:18:49 PHT 2012
@author Ted Hagos
A simple sql statement that can be used to test out database routines.
NOTE:
1. The date is inserted using a function of MySQL STR_TO_DATE. It follows US Date format
@tedhagos
tedhagos / README
Created May 5, 2012 07:41
My Latex Book Template
# Workflow and tool chain for writing a book for PDF publishing
## Toolchain
1. Pandoc, install using the cabal installer, don't apt-get. On OSX, there is dmg, I think the dmg is best option for OSX, it is just too problematic to get 1.9.2 cabal using brew or macports. There was one option I tried and succeeded, that is to install the Haskell environment using a package installer, that contained the cabal installer. Then install pandoc using cabal. Don't forget that the executables are in ~/.cabal/bin, so you have to set the path
2. TexLive, get the full distribution. It will take sometime to download, so get some coffee and be prepared to waste time
3. A good texteditor. ia Writer on OSX, vi (all around). Recently though, TextMate 2.0 Alpha seems to be a pretty good editor of Markdown
@tedhagos
tedhagos / FindGCF.java
Created July 28, 2012 10:16
RD Programming Concepts Training - Batch 1
/*
@Program name: FindGFC.java
Find the greatest common factor using Euclid's algorithm
*/
class FindGCF {
public static void main(String[] args) {
@tedhagos
tedhagos / Gui1.java
Created August 4, 2012 14:20
RD Programming Concepts Training - Batch 1 (part 2)
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.FlowLayout;
import javax.swing.*;
import java.awt.event.*;
class Gui1 extends JFrame implements ActionListener {
JLabel label = new JLabel("Your name: ");
JTextField tf = new JTextField(20);
@tedhagos
tedhagos / count.js
Created August 10, 2012 14:53
JavaScript Core
var util = require('util')
var i = 1;
var j = 1;
for (i = 1 ; i < 10; i++) {
for (j =1 ; j < 10; j++) {
util.print(i * j + "\t");
@tedhagos
tedhagos / poly2.m
Created November 19, 2012 13:43
Just messing around
/*
Protocols behave like interfaces in Java. You don't inherit implementation
but its a way to ensure that certain classes/objects do implement the
enforced methods
*/
#import <Foundation/Foundation.h>
@tedhagos
tedhagos / io.m
Created November 20, 2012 06:43
C Style strings to NSString
/*
An exercise on how to create NSString objects from C style chars
*/
#import <Foundation/Foundation.h>
#import <stdio.h>
@tedhagos
tedhagos / Prop.m
Created November 22, 2012 02:35
deleteme
/*
You do not need to write individual getter and setter methods for
members of the class. This can be accomplished using
@property and @synthesize. The @property directive is done on the
header source and synthesize on the implementation source
The method name convention is;
@tedhagos
tedhagos / Obj.m
Created November 22, 2012 02:56
delme
/*
Had trouble with [obj objname], it is not [obj getObjname], when
you are getting, simply call the instance member name, it is not
a string get/set pair with @property and @synthesize
Also, learn the following;
1. self
2. init