Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Joe Palala jpalala

🎯
Focusing
View GitHub Profile
@jpalala
jpalala / testcmd.rb
Created July 2, 2011 00:05
testing out command line arguments in ruby (and it was not that hard!)
class FooBar
def initialize(foo)
@foo = foo
end
def foo
puts "FooBar#foo @foo: #{@foo}"
end
def self.bar(options={})
puts "FooBar.bar options[:thing]: #{options[:thing]}"
end
@jpalala
jpalala / simple post form debug
Created August 17, 2011 09:44
print post array and auto generate variables for each input
print_r($_POST);
foreach($_POST as $v => $k)
{
echo '\$'. $v . ' = $_POST[\'' . $v . '\']<br>';
}
@jpalala
jpalala / tymings.py
Created October 15, 2011 04:14
Tells the time from a CET (Europe Time) to my Philippine Time
#!/usr/bin/python
from time import localtime,gmtime, strftime
from datetime import date
import datetime
import os
#public static void main argzzz {{{ :D
x = int(strftime("%Y"))
m = int(strftime("%m"))
d = int(strftime("%d"))
@jpalala
jpalala / repopulate data
Created October 20, 2011 03:38
post to another php page with data from form and then populate select
var data = { 'sonum' : $('#soid').val() };
$.post('ajax/get_available_roles.php', data,
function(postdata) {
$("select#roles").html(postdata);
},'html'); //returns <op>blahblah</op>
@jpalala
jpalala / db_driver_extension.php
Created November 16, 2011 08:15 — forked from Eclarian/db_driver_extension.php
CodeIgniter Database Driver Extension to simplify the CRUD actions within your app
<?php
/**
* Database Driver Extension
*
* DEPENDENCIES:
* CodeIgniter 2.x.x (with ActiveRecord turned on)
* is_associative() function -- place in autoloaded helper file. It should load early enough before any queries.
*
* This Extension allows you to insert/update, batch insert/batch update, and delete from any
* table within your database simply with an easy interface
@jpalala
jpalala / checking-post.php
Created December 8, 2011 06:25
checking post from codeignite
if($this->input->post('submit'))
{
print_r($_POST);
foreach($_POST as $post)
{
print $post;
}
}
@jpalala
jpalala / PM_agile_method_features_stories_database.sql
Created December 13, 2011 00:01
my super simple AGILE can be used for PM purposes database
--/*
--features:
-- feature_id feature created modified
--*/
--/*
--stories:
-- story_id story feature_id_fk
--*/
--
@jpalala
jpalala / installation routine.txt
Created March 14, 2012 06:01
What to install - web tools, xfce, openbox, utilities, with a minimalist ubuntu-alternate install
i installed xfce4 first using command line (alternate did not load the gnome stuff, used Ctrl+Alt+1 to get to a login screen)
//First I ran another update:
sudo apt-get update
#then installed a basic xfce4 window manager, and the slim login manager.
sudo apt-get install xfce4 slim
i installed lynx browser,openbox, tint2,sakura and another browser midori, as well as chromium-browser (free opensource browser, basis of google chrome
------------------------------------------------------
sudo apt-get install lynx openbox tint2 sakura midori chromium-browser
@jpalala
jpalala / fetchtweets_codeignite_model.php
Created March 31, 2012 14:30
Codeigniter Model - fetch tweets
<?php
/*
adapted from http://rosstanner.co.uk/2012/01/php-tutorial-twitter-statuses/
*/
class Mytweets extends CI_Model {
// define the account username
@jpalala
jpalala / exec_list_folder.php
Created April 20, 2012 03:34
Testing out exec on php
<?php
exec('ls files/', $output);
print_r($output); // $stuff;