Sometimes blues hacks

[philiptellis] I've been a programmer almost all my life. My code is scattered all over the place. Some of it is linked from here.


Featured hack: strftime.js

Detailed explanation about strftime.js

In the field below, enter any of strftime's supported format specifiers. The whole list is available with the PHP documentation for strftime. The result will be the current date using that format printed out in English, French and German.

Examples

Natural language:
%A, %d %B
ISO 8601:
%Y-%m-%dT%H:%M:%S%z
YYYY/mm/dd:
%Y/%m/%d
Preferred:
%c, %x, %r

Background:

strftime in Javascript

As a follow-up to my last post about Javascript date functions, I went ahead and implemented strftime for javascript.

Have a look at the demo at the link above, and download the code: strftime.js. It's distributed under a BSD license, so use it and give me feedback. Post comments here for now.The code is documented using doxygen style comments.

You should also check out Stoyan's time input library that lets you do the equivalent of php's strtotime function.

Update: This code is now part of the YUI library and all further development will be done there.

Hacks

  • lifebook
    A book style aggregator of my life with page flipping.
  • footsteppr
    Find travel co-incidences through geo-tagged flickr photos.
  • fetch-favicon.sh Detailed explanation about fetch-favicon.sh
    Fetch favicons for all feeds that go into a planet.
  • mkdrag.js Detailed explanation about mkdrag.js
    Script to make all divs on a page draggable.

Opensource stuff

  • html-template-javascript
    Project to port HTML::Template to javascript
  • make-icicidirect-better
    A bunch of greasemonkey scripts to make ICICIDirect a little better.
  • icici-direct-crawler
    Automate some of the things I do with ICICI Direct
  • yui-flot
    Port of Flot to YUI
  • netperf-js
    A Bandwidth tester in Javascript... but please use boomerang instead, I'm moving development there
  • 404kids
    Put missing kids on your 404 page
  • yui3-gallery
    YUI3 Gallery Modules
  • 4.01-strict
    Source code for the 4.01 Strict comic strip
  • packet-flight
    Watch the data fly
  • Idiocy
    Idiocy is a warning shot to people browsing the internet insecurely.
  • measures
    On screen measures for common units
  • yui3
    YUI 3.x Source Tree
  • boomerang
    End user oriented web performance testing and beaconing
  • pngtocss
    Read in a gradient from a png file and spit out CSS for it
  • httptype
    Find out which HTTP server runs on a given host/port
  • jsmodplayer
    A Javascript .MOD and .XM music player
  • node-ua-parser
    UserAgent Parser for NodeJS
  • js-yaml
    CommonJS YAML Parser -- fast, elegant and tiny yaml parser for javascript
  • node-geoip
    Native NodeJS implementation of MaxMind's GeoIP API -- works in node 0.5.4, aske me about other versions
  • gauss
    JavaScript statistics and analytics library - Node.JS ready
  • node-faststats
    Quickly calculate statistics of a running stream of data
  • node-PostgresClient
    PostgreSQL client module for Node.js. Most (if not all) PostgreSQL features should be supported. If something you need isn't supported, let me know :)
  • config
    Config files I use
  • strftime
    strftime for JavaScript
  • node-prettydate
    Pretty date formatting for Node.JS
  • JSLint
    The JavaScript Code Quality Tool
  • lala
    Licensing Avoids Legally Anxiety
  • node-gcstats
    A NodeJS library to tell you whether you're leaking, and how much.
  • node_redis
    redis client for node
  • HTML9-Responsive-Boilerstrap-js
    HTML9 Responsive Boilerstrap JS
  • CFP
    CFP
  • Ayttm
    A unified instant messenger client.
  • libyahoo2
    C library for the Yahoo! Messenger protocol.
  • HTML.Template.java
    Java port of the HTML::Template perl library.
  • httptype
    Figure out the web server running on a host or list of hosts.
  • tictactoe
    An implementation of the simple game that uses current board analysis rather than a lookahead tree to determine the best move.