Recent Updates Page 3 RSS Toggle Comment Threads | Keyboard Shortcuts

  • Mohammad Jangda 1:45 pm on April 30, 2011 Permalink | Reply
    Tags: carrots, fruits, garden, tomatoes, vegetables   

    Homemade Fruits and Vegetables 

    Some goodies we grew in our garden last year.

    The tomatoes turned out amazingly (despite looking pretty green in the photos). They were aggressive and being our first time growing vegetables, we didn’t quite control then well enough. As a result, we now have a big patch of dead grass in the garden where the tomatoes started to spread.

    The raspberries were delicious but the plant only sprouted 7 or 8 of them. It’s gotten much bigger this year, so we hope to get lots more.

    The carrots, well, they were tiny.

    There were a few delicious peppers as well (though, not pictured).

    This year, we’re going with tomatoes again, but might expand the patch of vegetables we have and try other things like potatoes and other small edibles. We’re also hoping that the cherry and plum trees we planted kick into high gear and pop out some delicious fruits.



    Posted from Mississauga, Ontario, Canada.

     
  • Mohammad Jangda 11:02 am on April 23, 2011 Permalink | Reply
    Tags: , libraries, philip pullman, reading   

    Philip Pullman on the upcoming library closures in Oxfordshire:

    I love the public library service for what it did for me as a child and as a student and as an adult. I love it because its presence in a town or a city reminds us that there are things above profit, things that profit knows nothing about, things that have the power to baffle the greedy ghost of market fundamentalism, things that stand for civic decency and public respect for imagination and knowledge and the value of simple delight.

    [...]

    Leave the libraries alone. You don’t know the value of what you’re looking after. It is too precious to destroy.

    He also brilliantly discusses my exact sentiments on the magic that is reading:

    But what a gift to give a child, this chance to discover that you can love a book and the characters in it, you can become their friend and share their adventures in your own imagination.

    And the secrecy of it! The blessed privacy! No-one else can get in the way, no-one else can invade it, no-one else even knows what’s going on in that wonderful space that opens up between the reader and the book. That open democratic space full of thrills, full of excitement and fear, full of astonishment, where your own emotions and ideas are given back to you clarified, magnified, purified, valued. You’re a citizen of that great democratic space that opens up between you and the book.

    (If you haven’t already, check out the His Dark Materials series by Pullman — it has the exact sort of “wonderful space” he’s talking about.)

     
  • Mohammad Jangda 4:17 pm on March 17, 2011 Permalink | Reply
    Tags: community, love,   

    We are all WordPress 

    We all use it, we love it, and we want to learn it, teach others, and help WordPress become even better.

    We are all WordPress.

    Jackie Dana

     
  • Mohammad Jangda 7:40 pm on March 14, 2011 Permalink | Reply
    Tags: family, team, work   

    Hello, Automattic 

    image

    My new work family.

    (via tychay)

     
  • Mohammad Jangda 11:35 am on March 6, 2011 Permalink | Reply  

    The need to code | jacquesmattheij.com 

    It’s like a drug. I’m still fascinated by it, even almost 30 years to the day later I still read about languages, new ways to solve old problems, all kinds of developments in software and hardware as though it is the first time that I hear about these things. It is a fascinating world, the world of software.

    Jacques Mattheij

     
  • Mohammad Jangda 1:50 pm on February 25, 2011 Permalink | Reply
    Tags: , , script, timer   

    JavaScript Countdown Timer 

    I was in search of a JavaScript countdown timer (mainly because I’m too lazy to build it out myself — and because I’m sure millions before me have done the same), but Google wasn’t doing me much good. Most scripts would modify the DOM, directly but not make it easy to programmatically intercept the remaining time.

    So, I picked one of the cleanest scripts and cleaned it up a bit.


    /**
     * A sweet js countdown timer with a custom callback that gives you a JSON object!
     * Heavily modified code originally found on http://www.ricocheting.com/code/javascript/html-generator/countdown-timer
     *
     * @param string|Date String representation of when to countdown to. Date objects probably work too
     * @param callback Function triggered when the interval has passed
     * @param int Number of milliseconds for the timeout. Defaults to 1000 (1 second)
     *
     * @return object Returns a JSON object with properties: days, hours, minutes, seconds
     */
    timer = function(endDate, callback, interval) {
        endDate = new Date(endDate);
        interval = interval || 1000;
    
        var currentDate = new Date()
            , millisecondDiff = endDate.getTime() - currentDate.getTime() // get difference in milliseconds
            , timeRemaining = {
                days: 0
                , hours: 0
                , minutes: 0
                , seconds: 0
            }
            ;
    
        if(millisecondDiff > 0) {
            millisecondDiff = Math.floor( millisecondDiff/1000 ); // kill the "milliseconds" so just secs
    
    		timeRemaining.days = Math.floor( millisecondDiff/86400 ); // days
    		millisecondDiff = millisecondDiff % 86400;
    
    		timeRemaining.hours = Math.floor( millisecondDiff/3600 ); // hours
    		millisecondDiff = millisecondDiff % 3600;
    
    		timeRemaining.minutes = Math.floor( millisecondDiff/60 ); // minutes
    		millisecondDiff = millisecondDiff % 60;
    
    		timeRemaining.seconds = Math.floor(millisecondDiff); // seconds
    
            setTimeout(function() {
                timer(endDate, callback);
            }, interval);
        }
    
        callback(timeRemaining);
    }
    

    It’s easy to use! You specify an end date (as a string, though Date object’s should work as well) and pass in a callback that gets triggered at a set interval. The callback receives a JSON object with properties for days, hours, minutes and seconds. You can pass in a custom interval if you want the callback triggered at a different period. Examples below.


    timer('2011-12-31', function(timeRemaining) {
    	console.log('Timer 1:', timeRemaining);
    });
    
    // This will run every minute, instead of every second
    timer('2012-12-31', function(timeRemaining) {
    	console.log('Timer 2:', timeRemaining);
    }, 60000);
    

    Interested? See it in action: http://jsfiddle.net/mjangda/vGv7J/1/

     
  • Mohammad Jangda 1:01 pm on February 16, 2011 Permalink | Reply
    Tags: , , , javascript errors,   

    JavaScript Tip: Bust and Disable console.log 

    Here’s a quick and dirty follow-up to my original Save me from console.log errors. The main improvement to this version is that it includes a way to disable console.log (and related functions), for example, in production environments.

    While console.log is awesome, you really don’t want your dirty inner workings littering up the Console (or visible to the user — though, you could make an argument that this is a great way to debug errors in live environments) once your app is deployed.

    Note: Firebug can get unhappy sometimes if you try to mess with its console object. But, in theory, this approach should work.


    var DEBUG_MODE = true; // Set this value to false for production
    
    if(typeof(console) === 'undefined') {
        console = {}
    }
    
    if(!DEBUG_MODE || typeof(console.log) === 'undefined') {
        // FYI: Firebug might get cranky...
        console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {};
    }
    

     
  • Mohammad Jangda 9:45 pm on January 24, 2011 Permalink | Reply  

    Photo: Maison du Festival de Jazz 

    Maison du Festival de Jazz
    Montreal’s illustrious jazz headquarters.

     
  • Mohammad Jangda 12:59 pm on January 8, 2011 Permalink | Reply
    Tags: snow, winter   

    Photo: Hello, snow. 

    image

    It’s no New York, but Mississauga finally got some serious snow this weekend.

     
  • Mohammad Jangda 2:46 pm on December 16, 2010 Permalink | Reply  

    Photo: “weigh & pay” 

    "weigh & pay"

    Taken at Swurl, a sweet froyo store in the heart of downtown Montreal. All ice cream places should be this cool.

    Apparently there’s one in Toronto?

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel