Skip to content

Instantly share code, notes, and snippets.

View MariuszWisniewski's full-sized avatar

Mariusz Wisniewski MariuszWisniewski

View GitHub Profile
@MariuszWisniewski
MariuszWisniewski / gist:1b391403e21b081ef90d7e820a505456
Created January 30, 2018 12:02 — forked from kublaios/gist:f01cdf4369c86ddd6d71
Making a PEM File for iOS Push Notifications (From Ray Wenderlich's tutorial)
# Convert the .cer file into a .pem file:
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
# Convert the private key’s .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
# Finally, combine the certificate and key into a single .pem file
$ cat PushChatCert.pem PushChatKey.pem > ck.pem
# At this point it’s a good idea to test whether the certificate works.
{% set objects = response.objects %}
<style type="text/css">
/*margin:0px auto;*/
.tg {border-collapse:collapse;border-spacing:0;border-color:#999;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#999;color:#444;background-color:#F7FDFA;border-top-width:1px;border-bottom-width:1px;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#999;color:#fff;background-color:#26ADE4;border-top-width:1px;border-bottom-width:1px;}
.tg .tg-baqh{text-align:center;vertical-align:top; max-width:50px;}
.tg .tg-yw4l{vertical-align:top; text-align:center; max-width:224px;}
.tg .tg-6k2t{background-color:#D2E4FC;vertical-align:top; text-align:center; max-width:50px;}
@MariuszWisniewski
MariuszWisniewski / add_username_to_all_user_profiles.py
Created June 24, 2016 20:52
Add usernames to user profiles of all Syncano users
import syncano
from syncano.models import User
from syncano.models import Object
syncano.connect(api_key='ACCOUNT_KEY', instance_name=META['instance'])
def add_username_to_user(user):
print user.id
user_profile = Object.please.list(
class_name='user_profile'
import UIKit
import syncano_ios
class Game : SCDataObject {
var name : String = ""
}
class Score : SCDataObject {
var name : String = ""
var game : Game? = nil
import syncano
from syncano.models import User
from syncano.models import Object
syncano.connect(api_key='ACCOUNT_KEY', instance_name=META['instance'])
user_id = ARGS['owner']
user_profile_id = ARGS['id']
user = User.please.get(
//
// ViewController.swift
// iOS
//
// Created by Mariusz Wisniewski on 2/18/16.
// Copyright © 2016 Mariusz Wisniewski. All rights reserved.
//
import UIKit
import syncano_ios
@MariuszWisniewski
MariuszWisniewski / create-channels.py
Created March 3, 2016 01:00
Create Channel in Python CodeBox
from syncano.models import Channel
import syncano
syncano.connect(api_key="ACCOUNT_KEY")
Channel.please.create(instance_name=META['instance'],
name="realtime2",
description="channel description",
type="default",
other_permissions="subscribe",
@MariuszWisniewski
MariuszWisniewski / create-channels.js
Created March 3, 2016 00:59
Create a channel in JS CodeBox
var Syncano = require('syncano'); //CommonJS
var account = new Syncano({accountKey: "ACCOUNT_KEY"});
var channel = {
"name":"realtime",
"type":"default",
"other_permissions": "subscribe",
"custom_publish": "false"
};
//
// ViewController.swift
// iOS
//
// Created by Mariusz Wisniewski on 2/18/16.
// Copyright © 2016 Mariusz Wisniewski. All rights reserved.
//
import UIKit
import syncano_ios
//
// ViewController.swift
// iOS
//
// Created by Mariusz Wisniewski on 2/18/16.
// Copyright © 2016 Mariusz Wisniewski. All rights reserved.
//
import UIKit
import syncano_ios