This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ShopData = new Bloodhound({ | |
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
remote: { | |
url: 'https://api.parse.com/1/classes/Shop?where={"name":{"$regex":"%QUERY"}}&limit=20', | |
wildcard: '%QUERY', | |
prepare: function (query, settings) { | |
// settings.type (method for jQuery 1.9+) default is GET | |
settings.dataType = 'json'; | |
settings.contentType = "application/json; charset=UTF-8"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Paste the following code into the class for the form: | |
private ListViewColumnSorter lvwColumnSorter = new ListViewColumnSorter(); | |
// 2. Paste the following code into the constructor for the form, after the call to the InitializeComponent method: | |
this.listView1.ListViewItemSorter = lvwColumnSorter; | |
// 3. Paste the following code into the ColumnClick event for the ListView control: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solution for window.stop(); in MSIE and Trident aka Edge | |
if (navigator.userAgent.match(/Trident|MSIE/) != null) { | |
document.execCommand("Stop"); | |
} else { | |
window.stop(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parse.Cloud.define("grecaptcha", function (request, response) { | |
Parse.Cloud.httpRequest({ | |
url: 'https://www.google.com/recaptcha/api/siteverify?secret=<Your Secret Key here>&response=' + request.params.key, | |
success: function (httpResponse) { | |
response.success(JSON.parse(httpResponse.text).success); | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parse.Cloud.afterSave("_User", function (request, response) { | |
Parse.Cloud.useMasterKey(); | |
var user = request.object; | |
query = new Parse.Query(Parse.Role); | |
// add user to the role named "General" | |
query.equalTo("name", "General"); | |
query.first({ | |
success: function (object) { | |
object.relation("users").add(user); | |
object.save(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LICENSE : https://gist.github.com/52c13856a6d59acaa86f.git | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Matrix; | |
import android.graphics.drawable.Drawable; | |
import android.util.AttributeSet; | |
import android.view.GestureDetector; | |
import android.view.MotionEvent; | |
import android.view.View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LICENSE : https://gist.github.com/52c13856a6d59acaa86f.git | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
public class ShopProxy implements Parcelable { | |
private static final long serialVersionUID = 1L; | |
private String name, category, description; | |
private boolean takeout, authorized; | |
private double latitude, longtitude; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LICENSE : https://gist.github.com/52c13856a6d59acaa86f.git | |
import com.parse.ParseClassName; | |
import com.parse.ParseGeoPoint; | |
import com.parse.ParseObject; | |
@ParseClassName("Shop") | |
public class Shop extends ParseObject { | |
public Shop() { | |
// A default constructor is required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2015 Scott Cheng <60510scott@gmail.com> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.*; | |
import android.util.AttributeSet; | |
import com.android.volley.toolbox.NetworkImageView; | |
public class FadeInNetworkImageView extends NetworkImageView { | |
private static final int FADE_IN_TIME_MS = 250; |
OlderNewer