Skip to content

Instantly share code, notes, and snippets.

View emilepetrone's full-sized avatar
🏠
Working from home

Emile Petrone emilepetrone

🏠
Working from home
View GitHub Profile
// delete a record
[client deleteRecord:@"recordID"
inLayer:@"com.simplegeo.example"
callback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// deletion confirmed
} failureBlock:^(NSError *error) {
// deletion failed
}]];
// add or update many records at once
[client addOrUpdateRecords:records // an array of records
inLayer:@"com.simplegeo.example"
callback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// additions/updates confirmed
} failureBlock:^(NSError *error) {
// additions/updates failed
}]];
// add or update a record
SGStoredRecord *record = [SGStoredRecord recordWithID:@"recordID"
point:[SGPoint pointWithLat:37.772445 lon:-122.405913]
layer:@"com.simplegeo.example"];
[record setCreated:date]; // optional
[record setProperties:propertiesDictionary]; // optional
[client addOrUpdateRecord:record
// get a list of feature & place categories
[client getCategoriesWithCallback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// you've got categories!
} failureBlock:^(NSError *error) {
// handle failure
}]];
// annotate a feature
[client annotateFeature:@"SG_7L9nQHjsporBjZUz8KVt5t"
withAnnotation:annotationDictionary
isPrivate:NO
callback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// annotation confirmed
} failureBlock:^(NSError *error) {
// annotation failed
// get a annotations for a feature
[client getAnnotationsForFeature:@"SG_7L9nQHjsporBjZUz8KVt5t"
callback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// you've got a annotations!
} failureBlock:^(NSError *error) {
// handle failure
}]];
// get a SimpleGeo feature
[client getFeatureWithHandle:@"SG_7L9nQHjsporBjZUz8KVt5t"
zoom:nil // polygon complexity (optional)
callback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// you've got a feature!
// to create an SGFeature object...
SGFeature *feature = [SGFeature featureWithGeoJSON:response];
} failureBlock:^(NSError *error) {
<script>
$(".vote").click( function() {
var votes = $(this).parent().find('.vote_num').attr('votes');
$.post(
'{% url vote %}', {
"id":this.id,
}, function(data) {});
this.className = "voted";
votes = parseInt(votes) + 1;
$(this).parent().find('.vote_num').text(votes);
@font-face {
font-family:'DSDotsMedium';
src:url('/static/roommanager_assets/font/dsdots-webfont.svg#webfontUp10bL9H') format('svg'), url('/static/roommanager_assets/font/dsdots-webfont.eot?') format('eot'), url('/static/roommanager_assets/font/dsdots-webfont.woff') format('woff'), url('/static/roommanager_assets/font/dsdots-webfont.ttf') format('truetype');
font-weight:normal;
font-style:normal;
}
#songboard {
font-family:'DSDotsMedium', Helvetica, Arial, sans-serif;
color:#dbcb98;
(function () {
var v = 0,
q = [],
o = {},
s = {},
A = {
"<": "lt",
">": "gt",
"&": "amp",
'"': "quot",