Skip to content

Instantly share code, notes, and snippets.

View halfbaked's full-sized avatar

Eamonn O'Connell halfbaked

View GitHub Profile
@thurloat
thurloat / formview.coffee
Created January 18, 2012 02:59
Backbone Form -> Model sync View
# FormView Class
#
# Backbone View subclass that will allow you to bind input fields
# to model fields and keep the data in sync using the same
# declarative syntax you're used to for Backbone Views.
#
# blog post: http://thurloat.com/2012/01/17/backbone-sync-models-and-views
#
# class TestView extends FormView
#
anonymous
anonymous / gist:2952418
Created June 19, 2012 05:17
Web dev horror story: Double billing bug
Early in my career I found myself working at a mobile content provider on a PHP/MySQL app that was developed in Eastern Europe by a plucky but perhaps not the most best practice oriented entrepreneurial developer.
A rather large business had been built on top of this platform and it was suffering from the strains of scaling (revenue was in the multiple millions by this point).
One day, I was working on some code clean up and refactoring to improve some functionality in the billing piece when I realized there was an error in the logic that would cause the customer to be double-billed for each piece of content. I dutifully filed a ticket for the bug, committed a fix, and deployed it to production.
In less than 2 hours, our sysadmin had rolled back my fix and the ticket changed to closed, won't fix, as the impact on the company sales projections was too much... I didn't stick around long after that!
@robfletcher
robfletcher / _Events.groovy
Created June 20, 2012 16:39
Automatically display last deployment time in your Cloud Foundry app
eventCfUpdateStart = {
metadata.'cf.last.deployed' = new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
metadata.persist()
}
@terenceponce
terenceponce / instructions.md
Created September 26, 2012 08:25
Setting up Thinking-Sphinx on Mac OS X using Homebrew

Out of the box, Homebrew does a default installation on Sphinx:

$ brew install sphinx

However, if you're using MySQL, the thinking-sphinx gem won't work because it needs to use MySQL libraries.

If you managed to screw up the first time, uninstall sphinx first:

$ brew remove sphinx

@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@kustra
kustra / HeaderFooterRecyclerViewAdapter.java
Last active March 15, 2021 03:58 — forked from mheras/HeaderFooterRecyclerViewAdapter.java
Header & footer support for RecyclerView.Adapter, with custom ViewHolder types for the content, header and footer
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
public abstract class HeaderFooterRecyclerViewAdapter<
ContentViewHolder extends RecyclerView.ViewHolder,
HeaderViewHolder extends RecyclerView.ViewHolder,
FooterViewHolder extends RecyclerView.ViewHolder>
extends RecyclerView.Adapter<RecyclerView.ViewHolder> {