Skip to content

Instantly share code, notes, and snippets.

View aijaz's full-sized avatar

Aijaz Ansari aijaz

View GitHub Profile
@aijaz
aijaz / Network.swift
Created August 22, 2017 16:11
Simple example of using NSURLSession
import Foundation
import UIKit
class Network {
static let sharedInstance = Network()
private init() {
} //This prevents others from using the default '()' initializer for this class.
class func retrieveJsonAtLocation (urlString: String, completionHandler: @escaping ()->Void) {
let url = Bundle.main.url(forResource: urlString, withExtension: "json")
@aijaz
aijaz / Network.m
Created August 22, 2017 16:13
Simple example of using NSURLSession - Objective-C
#import "CCNetwork.h"
@implementation CCNetwork
+(void) retrieveJSONAtLocation: (NSString *) urlString completionHandler: (void (^)(NSData *data, NSURLResponse *response, NSError *error)) handler {
NSURL *url = [[NSBundle mainBundle] URLForResource:urlString withExtension:@"json"];
[CCNetwork retrieveJSONAtURL:url completionHandler:handler];
}
+(void) retrieveJSONAtURL: (NSURL *) url completionHandler: (void (^)(NSData *data, NSURLResponse *response, NSError *error)) handler {
@aijaz
aijaz / makeCSR.sh
Created December 12, 2018 17:41
Create a Certificate Signing Request for a domain name
#!/bin/bash
# Aijaz Ansari
# This work is licensed under the Creative Commons Attribution 4.0
# International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
# This script takes in one parameter, a domain name.
import sys
from PyQt5.QtWidgets import QApplication, QListWidget, QMainWindow
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("My App")
@aijaz
aijaz / Debug.swift
Created May 23, 2021 17:56 — forked from chockenberry/Debug.swift
Debug and release logging in Swift that's reminiscent of NSLog()
//
// Debug.swift
//
// Created by Craig Hockenberry on 3/15/17.
// Usage:
//
// SplineReticulationManager.swift:
//
@aijaz
aijaz / summary.md
Last active May 5, 2023 22:33
Notes for my Advanced Git class

Advanced Git

by Aijaz Ansari

Gogo Con 5/3/2023

Introduction

What you will learn

  • correct mental model necessary to understand git
  • how to manipulate commits and branches
@aijaz
aijaz / cookies.txt
Created June 10, 2024 15:15
Cookies
r:
# Make the dough
# Portion the dough
# Bake the cookies
# Cool the cookies
i:
INGREDIENTS