Skip to content

Instantly share code, notes, and snippets.

View vrat28's full-sized avatar
💭
do { programming() } while !success

Varun vrat28

💭
do { programming() } while !success
View GitHub Profile
@funmia
funmia / ios-interview-resources.md
Last active September 2, 2023 07:29
General iOS, CS questions and interview prep resources.
@watanabetoshinori
watanabetoshinori / GPXPlayground.swift
Created May 9, 2018 05:11
Generate the GPX data from origin and destinations using the Apple MapKit.
import MapKit
import PlaygroundSupport
// MARK: - Configuration
let input = "東京駅 東京タワー" /* Origin and destinations */
let speed: Double = 40.0 /* 40km/h */
@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@manjeshpv
manjeshpv / Apple Push Notification APNS PHP Snippet.php
Last active May 24, 2023 22:56
Apple Push Notification APNS PHP Snippet - Server Side Implementation
<?php
$deviceToken = '6e1326c0e4758b54332fab3b3cb2f9ed92e2cd332e9ba8182f49027054b64d29'; // iPad 5s Gold prod
$passphrase = '';
$message = 'Hello Push Notification';
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'pushcert.pem'); // Pem file to generated // openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts // .p12 private key generated from Apple Developer Account
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); // production
// $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); // developement