Skip to content

Instantly share code, notes, and snippets.

View mserge's full-sized avatar

Serge Markov mserge

  • NSPK, iFellow
  • Novosibirsk, Russia
View GitHub Profile
@desamtralized
desamtralized / ParseDelegate.kt
Created June 3, 2015 03:12
Accessing ParseObject properties in a easy way using Kotlin Data Class and Delegate.
//Define your sublclass of ParseObject
ParseClassName("Person")
public data class Person : ParseObject() {
var name: String by ParseDelegate<String>()
var age: Int by ParseDelegate<Int>()
var avatar: ParseFile by ParseDelegate<ParseFile>()
}
//Define ParseDelegate
public class ParseDelegate<T> {
@tortuetorche
tortuetorche / 01.FiniteAuditTrail.README.md
Last active May 14, 2024 08:21
FiniteAuditTrail Trait For Laravel 4 with Example. Support for keeping an audit trail for any state machine, borrowed from the Ruby StateMachine audit trail gem.

FiniteAuditTrail Trait

Support for keeping an audit trail for any state machine, borrowed from the Ruby StateMachine audit trail gem. Having an audit trail gives you a complete history of the state changes in your model. This history allows you to investigate incidents or perform analytics, like: “How long does it take on average to go from state a to state b?”, or “What percentage of cases goes from state a to b via state c?”

Requirements

  1. PHP >= 5.4
  2. Laravel 4 framework
@jamiechapman
jamiechapman / ParseProxyObject.java
Last active March 14, 2019 07:37
A Parse.com Serializable ParseObject Proxy
// By Jamie Chapman, @chappers57
// License: open, do as you wish, just don't blame me if stuff breaks ;-)
public class ParseProxyObject implements Serializable {
private static final long serialVersionUID = 1L;
private HashMap<String, Object> values = new HashMap<String, Object>();
public HashMap<String, Object> getValues() {
return values;