Skip to content

Instantly share code, notes, and snippets.

View selecsosi's full-sized avatar

Sam Lahti selecsosi

View GitHub Profile
@selecsosi
selecsosi / docker-compose.yml
Created July 31, 2018 20:00
Config sample
version: '3.5'
services:
nginx:
build:
context: .
dockerfile: ./nginx/Dockerfile
image: sngfnch/nginx
restart: always
ports:
- "80:80"
@selecsosi
selecsosi / gist:5d41dae843b9dea4888f
Last active August 29, 2015 14:17
Observable inputs which update html elements elsewhere in the page. This is used to create dynamic code snippets
var ObservableInputField = Backbone.View.extend({
dataKey: "",
bindable: false,
lastSavedValue: null,
defaultOptions: {
selectorPrefix: ""
},
events: {
"keyup": "onChange",
"focus": "onFocus",

Keybase proof

I hereby claim:

  • I am selecsosi on github.
  • I am selecsosi (https://keybase.io/selecsosi) on keybase.
  • I have a public key whose fingerprint is 64F2 EBCF 94C6 D354 E679 6A74 80D1 0CF2 621B 3B66

To claim this, I am signing this object:

@selecsosi
selecsosi / gist:5ec913885abeba4f7db4
Created July 2, 2014 23:51
Registering models 2x, once with (app, model) and one with model_class
def register_draft_only(model_class, fields, follow, format):
"""
version of the reversion register function that only registers drafts and
ignores public models
"""
revision_manager = reversion.revision
if revision_manager.is_registered(model_class):
raise RegistrationError(
"%r has already been registered with Reversion." % model_class)
@selecsosi
selecsosi / gist:6705630
Created September 25, 2013 20:34
This is an asyncTask using the geocoder falling back to a HttpRequest using volley to find a location
/**
* Task to lookup the LatLng of an address
*/
public class SearchForLocationTask extends AsyncTask<String, Void, LatLng> {
private static final String TAG = SearchForLocationTask.class.getSimpleName();
Context mContext;
//Get static reference to requestQueue
RequestQueue mRequestQueue = MyApplication.getInstance().getRequestQueue();