Skip to content

Instantly share code, notes, and snippets.

View tedhagos's full-sized avatar

Ted Hagos tedhagos

View GitHub Profile
@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 / 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
@tedhagos
tedhagos / gist:4129246
Created November 22, 2012 03:06
obj.m
#import <Foundation/Foundation.h>
#import "Prop.h"
@implementation Prop
@synthesize one, two;
- (void) printem {
NSLog(@ "One is %i and Two is %i", one, two);
}
@tedhagos
tedhagos / index.html
Created November 25, 2012 12:53
Really fluid layouts
<!DOCTYPE html>
<html>
<head>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"
</script>
<script src="jquery.isotope.min.js"></script>
<script src="tlb.js"></script>
</head>
<body>