Skip to content

Instantly share code, notes, and snippets.

View JaleelNazir's full-sized avatar
🚣‍♀️
Focusing

Jaleel Nazir JaleelNazir

🚣‍♀️
Focusing
View GitHub Profile
@JaleelNazir
JaleelNazir / jwt-apple-signin.py
Created October 29, 2020 18:58 — forked from davidhariri/jwt-apple-signin.py
Code required to verify Sign in with app-made Apple JWT tokens server-side in Python
import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
import os
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None
@JaleelNazir
JaleelNazir / jwt-apple-signin.py
Created October 29, 2020 18:58 — forked from davidhariri/jwt-apple-signin.py
Code required to verify Sign in with app-made Apple JWT tokens server-side in Python
import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
import os
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None
def generate_RSA(bits=2048):
'''
Generate an RSA keypair with an exponent of 65537 in PEM format
param: bits The key length in bits
Return private key and public key
'''
from Crypto.PublicKey import RSA
new_key = RSA.generate(bits, e=65537)
public_key = new_key.publickey().exportKey("PEM")
private_key = new_key.exportKey("PEM")
@JaleelNazir
JaleelNazir / letsencrypt_2017.md
Created September 19, 2019 13:14 — forked from grigorkh/letsencrypt_2017.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

@JaleelNazir
JaleelNazir / AppDelegate.swift
Created February 5, 2019 10:06 — forked from sawapi/AppDelegate.swift
[Swift] Push Notification
//
// AppDelegate.swift
// pushtest
//
// Created by sawapi on 2014/06/08.
// Copyright (c) 2014年 sawapi. All rights reserved.
//
// iOS8用
import UIKit
@JaleelNazir
JaleelNazir / rm_mysql.md
Last active May 11, 2018 18:33 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

import UIKit
class FadeInOut: UIStoryboardSegue {
override func perform() {
let sourceView: UIView = self.source.view as UIView!
let destinationView: UIView = self.destination.view as UIView!
sourceView.alpha = 1.0
localeIdentifier Description
eu Basque
hr_BA Croatian (Bosnia & Herzegovina)
en_CM English (Cameroon)
rw_RW Kinyarwanda (Rwanda)
en_SZ English (Swaziland)
tk_Latn Turkmen (Latin)
he_IL Hebrew (Israel)
ar Arabic
uz_Arab Uzbek (Arabic)
protocol NotificationType {
var name: Notification.Name { get }
static var name: Notification.Name { get }
var userInfo: [AnyHashable : Any] { get }
init?(notification: Notification?)
}
struct Notifications { }
@JaleelNazir
JaleelNazir / BaseUrl.swift
Created March 29, 2017 14:04 — forked from rajohns08/BaseUrl.swift
iOS / Swift - Base url class for getting from environment
class BaseURL {
class func getFromEnvironment() -> String {
#if DEBUG
return "http://192.168.1.126"
#else
return "https://judgecardx.com"
#endif
}