Skip to content

Instantly share code, notes, and snippets.

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

Amit Moryossef AmitMY

🏠
Working from home
  • Bar-Ilan University
  • Israel
View GitHub Profile
@trbsi
trbsi / PushNotifications.php
Last active March 11, 2018 04:18 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications
{
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAXXXXX-XXXXXJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
@norioxkimura
norioxkimura / json-utf8.py
Created April 30, 2012 14:51
Python 2.7: Save unicode string to file not using '\uXXXX' but using UTF-8.
# -*- coding: utf-8 -*-
import json
from codecs import open
o = { 'text': u'木村' }
with open('foo.json', 'w', encoding= 'utf-8') as fp:
json.dump(o, fp, ensure_ascii= False)