Skip to content

Instantly share code, notes, and snippets.

View maxschulze's full-sized avatar

maxschulze maxschulze

View GitHub Profile
class JuryReview
# some mongo fields here, not called round_number nor rapper_slug
# Now let's have a getter and setter, these are the names for the form fields as well, e.g.
# f.select :rapper - This should render a select with <option value="ID OF THE RAPPER OR SLUG">WHATEVER</option>
# f.input :round_number
attr_accessor :round_number, :rapper
# Implement the setter first
@maxschulze
maxschulze / response.json
Created April 2, 2014 14:26
Medium JSON Response when embedding instragram photo
])}while(1);</x>{"success":true,"payload":{"value":{"mediaResourceId":"4d88f1591274c093c3a9118475a648c2","mediaResourceType":"MediaResourceExternalLink","href":"http://instagram.com/p/l7pkYuHtBW/","domain":"instagram.com","title":"At work with @neymarjr and @mariotestino for @voguebrasil 📷💄 No trabalho com @neymarjr e @mariotestino para @voguebrasil","description":"giseleofficial's photo on Instagram","iframeWidth":0,"iframeHeight":0,"iframeSrc":"","type":"MediaResource"},"references":{}},"v":3,"b":"8398-ee46537"}
@maxschulze
maxschulze / placeholder.js
Created May 23, 2014 15:22
placeholder example
$(document).ready ->
$("[placeholder]").focus(->
input = $(this)
if input.val() is input.attr("placeholder")
input.val ""
input.removeClass "placeholder"
).blur(->
input = $(this)
if input.val() is "" or input.val() is input.attr("placeholder")
websocket = new WebSocket("ws://localhost:8080/");
websocket.onmessage = function(evt) {
$('#messages').append($('<li>').html(evt.data));
};
websocket.onerror = function(evt) {
$('#messages').append($('<li>').text('<span style="color: red;">ERROR:</span> ' + evt.data));
};

Keybase proof

I hereby claim:

To claim this, I am signing this object: