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, "") ||
shExpMatch(host, "(*|"))
return "DIRECT";
// If the protocol or URL matches, send direct.
if (url.substring(0, 4)=="ftp:" ||
shExpMatch(url, "*"))
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.


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
method: 'POST',
url: '',
headers: {
'Authorization': 'key=' + GCM_API_KEY,
'Content-Type': 'application/json'
body: {
registration_ids: gcmRegIds,
data: {
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;
public void onReceive(Context context, Intent intent) {
sheng168 / gist:5311009
Created Apr 4, 2013 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");