Skip to content

Instantly share code, notes, and snippets.

View aijaz's full-sized avatar

Aijaz Ansari aijaz

View GitHub Profile
@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 / 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:
//
import sys
from PyQt5.QtWidgets import QApplication, QListWidget, QMainWindow
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("My App")
@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.
@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 / 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 / DebuggingLinks.txt
Created April 22, 2017 02:14
Links from my talk on debugging: Beyond Breakpoints - Advanced Debugging With XCode
# GIT aliases
alias gl='git --no-pager log --graph --all --pretty="%C(auto)%h%Creset %C(blue)%cd%Creset %C(auto)%d%Creset %s" --date=local -20'
alias glp='git lp'
alias glpp='git lpp'
@aijaz
aijaz / ST3ToKeynote.markdown
Last active September 10, 2015 19:13
Copying from SublimeText3 to Keynote:
  • Assuming you're using the PackageControl.io module
  • Install package named 'Highlight'. You don't need to create a repo or anything else.
  • URL for the package (shouldn't need it) is https://packagecontrol.io/packages/Highlight
  • Go to Preferences > Package Settings > SublimeHighlight and set the prefs otherwise pasted text looks awful. I use:
{
    "theme": "monokai",
    "linenos": "inline",
 "noclasses": true,
CREATE TABLE movies (
firstName VARCHAR(32) NOT NULL
, lastName VARCHAR(32) NOT NULL
, year INT NOT NULL
, title VARCHAR(256) NOT NULL
);
CREATE TABLE alphabet (
letter char NOT NULL
);