Skip to content

Instantly share code, notes, and snippets.

View pac.js
function FindProxyForURL(url, host) {
// If the hostname matches, send direct.
if (dnsDomainIs(host, "intranet.domain.com") ||
shExpMatch(host, "(*.abcdomain.com|abcdomain.com)"))
return "DIRECT";
// If the protocol or URL matches, send direct.
if (url.substring(0, 4)=="ftp:" ||
shExpMatch(url, "http://abcdomain.com/folder/*"))
View Frosted-Glass-Effect:-1.0.0-beta.1.markdown

Frosted Glass Effect: 1.0.0-beta.1

An implementation of the iOS 7 Frosted Glass Blur in HTML5 with the Ionic Framework.

A Pen by Ionic on CodePen.

License.

@sheng168
sheng168 / gist:5877256
Created Jun 27, 2013
If you're like me and don't care about non-Google devices and would rather not have yet another background service running, you can easily send GCM notifications from CloudCode.
View gist:5877256
Parse.Cloud.httpRequest({
method: 'POST',
url: 'https://android.googleapis.com/gcm/send',
headers: {
'Authorization': 'key=' + GCM_API_KEY,
'Content-Type': 'application/json'
},
body: {
registration_ids: gcmRegIds,
data: {
@sheng168
sheng168 / gist:5502894
Created May 2, 2013
android detect screen on/on
View gist:5502894
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
public class ScreenReceiver extends BroadcastReceiver {
public static boolean screenOff;
@Override
public void onReceive(Context context, Intent intent) {
@sheng168
sheng168 / gist:5311009
Created Apr 4, 2013
parse.com security cloudcode
View gist:5311009
/*
* set an ACL on object with no permissions
*/
exports.lockDown = function(object) {
acl = new Parse.ACL();
console.log("removing all access");
object.setACL(acl);