GithubHelp home page GithubHelp logo

public's Introduction

Polsonby

Sample files to show coding style

Amazon S3 synchronization script
This was to copy files from our account at Amazon S3 that users had uploaded there directly from a bunch of sources, down to our local box for backup. It was designed to scale to synch many thousands of files at regular intervals, using background processes and a simple queuing solution done in MySQL. We used the MD5 hash of each file that Amazon provides to see if the current file up there had changed from the local copy; the hashes for the local files were stored in MySQL so it all ran quite quickly

S3.php - this class is a wrapper I wrote for the third-party class which provides the basic underlying functionality for talking to S3, by Dominic Schonknecht. We evaluated the S3 support in Zend framework and found one really wrong-headed design error in it that would have resulted in hundreds of thousands of additional calls to Amazon or required us to hack ZF, which I wanted to avoid at all costs, so used Dominic's tool instead - worked really well

amazonS3Sync.php - one of several CLI scripts for the solution, this one run every so often by cron


XML Feed reader and image resizer
It takes an XML feed and caches it locally. It takes the image referenced in the feed and creates local copies at the right image sizes for the thumbnails and so on. This version only caches the first page; in the next version I was going to make it cache the subsequent pages as well. The caching was to avoid problems with performance and perhaps availability, relying on a 3rd party provider

feed.php - this was intended to be used by another web designer so spent some care on API so it was easy for him to drop into some simple PHP pages he was building. 

api.txt - API documentation for the above

jQuery code
I hate disorganised jQuery code, which can easily turn into a vast pile of anonymous functions and event handlers. Using object literals helps to keep it tidy and organised. Anonymous functions are kept to an absolute minimum so as to make navigating the code simpler and to encourage modular code

contacts.js - this is an edited version of a real file, trimmed for compactness

public's People

Contributors

polsonby avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.