Nov 28

need a way to find all the dates in between? well this currently works with months. but can be adjusted to do days, years, etc. all you need to do is supply a begining date and an end date. it returns an array which can be used for anything,


function between_dates($begin_date, $end_date) {
$t = date("Y-m",strtotime($begin_date));

$i=0;
do {
$my[$i] = date(”F Y”, (strtotime(”{$end_date} +$i months”)));
$mys = date(”Y-m”, (strtotime(”{$end_date} +$i months”)));
$i++;
}
while($mys < $t);

return $my;
}

advertisments: if you feel compelled to click on any, please do!

Sep 12

RubyOnRails vs. Django.
it seems there’s nothing to compare, cept the main language, ones Ruby, the other Python. if Ruby and Python got married their kids would be called poobee, or roothon, i like poobee more, since it sounds like flowerpoop.

RubyOnRails vs. Java.
Java well it has its thing.

RubyOnRails vs. PHP
I bet the Guys from ZF saw this and laughed. ZF has that right? there’s alot of commewrcials for the RubyOnRails vs. PHP. I wonder what developers they are targeting. hmmmmm. I’m currently learning RoR. so i will see. go here for a Beautifuly done tutorial

RubyOnRails vs. .NET
so funny. hands down funny. Cutting Edge!

RubyOnRails vs. ColdFusion
myspace.com wow. Twitter! whats corba. emo kids

advertisments: if you feel compelled to click on any, please do!

Aug 27


whilst I was working on doing web stuff for my company i came across a strange phenomenon doing cross browser stuff.

my task was to create curved corners on div boxes. First i thought man this is gonna be cake. since there is a handy dandy jQuery plugin i could use in doing so. you can see more of that here

the jquery plugin source is here

basically all you have to do is add the jQuery string argument at the end of your selector.

code:

$("#your_block_id").corner("the parameters");

the parameters are basically this

.corner(”effect corners width”);

so to get a regular rounded corner block you can do something like this. since round is the default. all you have to do is put the pixel sizes as the parameter.

code:

$("#your_block_id").corner("10px");

demo:

flowerpoop life.
lorem ipsum dolar

so that solved the problem withe corners, its lightweight, and under 8k compressed and packed.
very quick load time.

The other thing is regarding the strangeness of tranparent pngs for backgrounds, and you will need to see this in IE7 and firefox3 which is what i’m running at the moment. although any flavor of Firefox will suffice.

As I was using the curvy corners jQuery plugin to make all the corners curvy on the block items. i was asked to place borders around all the blocks. The jQuery corner plugin is great for non border objects, but a different approach was needed in order to get the bordered corners. this is one approach i usually take when i just don’t want to think and use a CSS approach. Plus i think its just fine for what i need. Although there is a Stu Nichols Approach for doing a complete CSS version. but to me is not all scalable for multiple objects. and i admit i’m just lazy.

I used a combination of css and images.

here is the css

.topbar {
    position:relative;
    border:1px solid #6a6a6a;
    background:transparent url(images/333back.png);
    width:201px;
    padding:15px;
    margin:10px auto 0 auto;
    text-align:center;
}
.topbar .header_lt {
    position:absolute;
    height:10px;
    width:10px;
    left:-1px;
    top:-1px;
    background:#000 url(images/lt_header.png) no-repeat scroll center top;
}
.topbar .header_lb {
    position:absolute;
    height:10px;
    width:10px;
    left:-1px;
    bottom:-1px;
    background:#000 url(images/lb_header.png) no-repeat scroll center top;
}
.topbar .header_rt {
    position:absolute;
    height:10px;
    width:10px;
    right:-1px;
    top:-1px;
    background:#000 url(images/rt_header.png) no-repeat scroll -2px 0;
}
.topbar .header_rb {
    position:absolute;
    height:10px;
    width:10px;
    right:-1px;
    bottom:-1px;
    background:#000 url(images/rb_header.png) no-repeat scroll -2px 0;
}

here is the code

<div class="topbar" style="font-size: 13pt;">
<div class="header_lt"></div>
<div class="header_lb"></div>
<div class="header_rt"></div>
<div class="header_rb"></div>
LOREM IPSUM DOLAR
</div>

so here are 2 blocks.
the first one uses the 1px background block.

 
 
 
 

LOREM IPSUM DOLAR

this one uses the 100 x 100 px background block.

 
 
 
 

LOREM IPSUM DOLAR

In Firefox they look identical, in IE7 you can see that one has a gradient. Bizarre eh? I though so.
so the fix is just making the background image a bit larger. that’s about it.

here are the images i used for this demonstration

advertisments: if you feel compelled to click on any, please do!

Jul 16

So the regular column count in wordpress’ is 3, and in order to change this number, there isn’t any place in the settings to change it. so basically in order to change this, you will have to have a minor bit of programming knowledge, a good text editor. and some gumption.

first thing you do is open up your FTP client or telnet client putty.exe and go into your blog directory. If in case of FTP, grab this file.

/yourblogdir/wp-includes/media.php

open up the file. using your text editor, (I prefer editplus if i didnt have shell access to the server, and nano on the shell. No real Programmers use nano –see awesome xkcd.com panel on the bottom )and do a search for this string,

function gallery_shortcode($attr)

this should be line 400 if you are using putty.exe, look for this bit of code below, and change the “columns” from 3 to 4. and save.

now also remember you have to take in consideration what your width of your post frame is.

        extract(shortcode_atts(array(
                'order'      => 'ASC',
                'orderby'    => 'menu_order ID',
                'id'         => $post->ID,
                'itemtag'    => 'dl',
                'icontag'    => 'dt',
                'captiontag' => 'dd',
                'columns'    => 4,
                'size'       => 'thumbnail',
        ), $attr));

All set. Have fun Blogging.

from xkcd.com

 

real programmers use nano

real programmers use nano

advertisments: if you feel compelled to click on any, please do!

Jun 20

You ever wonder how to re-create those cool looking slider techniques in the apple iphone?
well you too can create them on your website using simple tools like jQuery and jQuery Ui

off
on

first thing is throw in your header the 2 files needed,

<script src="/js/jquery.js" type="text/javascript"><script>
<script src="/js/ui-jquery.js" type="text/javascript"><script>

grab the images.

and this code, throw the script and style in the head of your page.

<script>
//
// required jquery , and jquery ui
// created by flowerpoop
// share with all your friends.
// questions? leave a comment below.
//
//
$(document).ready(function(){
    $("#block").draggable(
        { // drag along the x-axis and stay in the parent
        axis: "x",
        containment: "parent",
        snap: $("#bar"),
        snapMode: 'inner',
        snapTolerance: 20,
        stop: function() {
            position = $("#block").position();
            if (position.left > 100) { //changes the postion of the arrow
                $("#bk").attr("src","/images/s_bar_left.png");
                $("#ss").attr("class","shaded");
                $("#uns").attr("class", "solid");
            };
            if (position.left < 10) {  //changes the postion of the arrow
                $("#bk").attr("src","/images/s_bar_right.png");
                $("#ss").attr("class","solid");
                $("#uns").attr("class","shaded");
            };
        }
        }
    );
    //makes clicking on the text as well
    $("#uns").click(function(){
        $("#block").animate(
        {left: 0},
        500,
        null,
        function(){
            $("#ss").attr("class","solid");
            $("#uns").attr("class","shaded");
            $("#bk").attr("src","/images/s_bar_right.png");
        });
    });
    //makes clicking on the text as well
    $("#ss").click(function(){
        $("#block").animate(
        {left: 111},
        500,
        null,
        function(){
            $("#ss").attr("class","shaded");
            $("#uns").attr("class","solid");
            $("#bk").attr("src","/images/s_bar_left.png");
        });
    });
});
</script>
<style>
.shaded {
    cursor:pointer;
    font-size:8pt;
    margin:0 3px;
    color:#FFFFFF;
    opacity: 0.1;
    margin-top:5px;
    filter: alpha(opacity=10)
}
.solid {
    cursor:pointer;
    font-size:8pt;
    margin:0 3px;
    margin-top:5px;
}
#bar {
    position:relative;
    margin:0 2px;
    background:transparent url('/images/s_bar.png') no-repeat scroll center top;
    width:145px;
    height:23px;
}
#block {
    cursor:pointer;
    position:absolute;
    margin-top:2px;
    z-index:1
}
</style>

<div id="bar">
    <div id="block">
        <img id="bk" src="/images/s_bar_right.png" />
    </div>
    <div id="uns" class="shaded" style="float:left;">off</div>
    <div id="ss" class="solid" style="float:right;">on</div>
</div>

advertisments: if you feel compelled to click on any, please do!

Jun 16

for some strange reason i keep getting hit with spam registrations.

Today’s bot registered with a name of jacob73kolp and an e-mail address of jacobkolp@gmail.com.

This brings the total of known bots to five:

  • adol77dai51
  • alina77vere9uk
  • ralyjones25
  • ken75muraski
  • jacob73kolp

I have placed these non poopers in my blacklist.
its an easy wordpress plugin.

http://web-professor.net/scripts/

the guy who runs it looks like steven colbert.

advertisments: if you feel compelled to click on any, please do!

Mar 2

so word press has a new gallery feature and it kinda doesn’t go with what your theme is right? the borders are all off, and they are spaced all strange. well with a bit of knowledge in CSS and PHP you can make these changes.

first off what i did to find this bit of code was use the grep command on the command line.

#grep -i -n -R "gallery" * > gallery.txt

this basically returns all your grepped information into a text file with the appropriate line number in the file name, this way you can see where yo locate this bit of code you need to change.

it basically told me that i needed to find this file “wp-content/shortcodes.php”

in this code on line 133 you will find the short codes function or called gallery_shortcode

inside this function you will see this bit of code.


     $output = "
          <style type='text/css'>
               .gallery {
                    margin: auto;
               }
               .gallery div {
                    float: left;
                    margin:10px;
                    text-align: center;
               }
               .gallery img {
                    border: 0px;
               }
          </style>
     ";

this is the gallery css code. you can change it as i have above, or make it which ever way you want.
i chose to remove the width, and mak it all float over the side. it looks better in my eyes. if you want to center your gallery images, just add text-align:center to the gallery css portion. remove the float, and add “width:100px; display:inline;” and they should line up magically.

have fun gallerying!

advertisments: if you feel compelled to click on any, please do!