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
############################################# | |
# Info backend requirements: | |
# - device token hash saved in database | |
# - number of unred notifications for token hash | |
# - Apple Certification File | |
# - SSL Key | |
# | |
# Info communication requirements: | |
# - what kind of notification | |
# - json data |
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
# Quick and Dirty DRAFT for Google Cloud Messaging REST by Petnik | |
import random | |
import requests | |
import json | |
api_key = 'XXXXXXXxXXXXXXXxXXXXXXXxXXXXXXXx' | |
gateway = 'https://android.googleapis.com/gcm/send' | |
################## |
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
<html> | |
<body> | |
<script> | |
var canvas = document.createElement("canvas") | |
var context = canvas.getContext("2d"); | |
var connection = new WebSocket('XXXXX'); | |
connection.binaryType = "arraybuffer"; |
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
#723610554 | |
self="$(pwd)/$(basename "$0")" | |
checksum="$(cat "$self" | awk '{if(NR>1)print}' | cksum | awk '{ print $1 }')" | |
sed "1s/.*/#$checksum/" $self > "$self.bak" | |
rm $self | |
mv "$self.bak" $self |
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
#! /usr/bin/env python | |
import sys | |
import signal | |
import os | |
import fcntl | |
import termios | |
import struct | |
block = os.O_NONBLOCK if 'O_NONBLOCK' in dir(os) else ( | |
os.NOBLOCK if 'NONBLOCK' in dir(os) else None) |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import signal | |
import os | |
import fcntl | |
import termios | |
import struct |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import signal | |
import os | |
import fcntl | |
import termios | |
import struct | |
import itertools |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import sys | |
import time | |
import struct | |
import hashlib | |
import binascii |
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
# determining native complexity | |
5091 function calls (4927 primitive calls) in 0.009 seconds | |
Ordered by: standard name | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
2 0.000 0.000 0.000 0.000 UserDict.py:18(__getitem__) | |
11 0.000 0.000 0.000 0.000 UserDict.py:58(get) | |
13 0.000 0.000 0.000 0.000 UserDict.py:70(__contains__) |
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
function exists(e) { | |
return { | |
[false]: false, | |
[void 0]: true | |
}[{ | |
[void 0]: false, | |
[{}]: false, | |
[false]: false, | |
[undefined]: false, | |
[1 / 0]: false |
OlderNewer