Skip to content

Instantly share code, notes, and snippets.

View shams-ahmed's full-sized avatar
🌞

Shams Ahmed shams-ahmed

🌞
View GitHub Profile
@gwengrid
gwengrid / TypeErasure.swift
Last active September 12, 2018 05:14
Example of type erasure with Pokemon
class Thunder { }
class Fire { }
protocol Pokemon {
typealias PokemonType
func attack(move:PokemonType)
}
struct Pikachu: Pokemon {
typealias PokemonType = Thunder
@lostincode
lostincode / CollectionViewDataSource.swift
Last active December 27, 2018 16:38
Lighter View Controller (UICollectionViewDatasource) in Swift
//
// CollectionViewDataSource.swift
//
// Created by Bill Richards on 10/1/14.
// Copyright (c) 2014 Bill Richards. All rights reserved.
//
import Foundation
typealias CollectionViewCellConfigureBlock = (cell:UICollectionViewCell, item:AnyObject?) -> ()
@AlamofireSoftwareFoundation
AlamofireSoftwareFoundation / alamofire-04-27-2015-statement.md
Last active January 10, 2020 06:25
A response to recent concerns about security vulnerabilities in AFNetworking

Last week, a number of publications ran a story about 1,000's of apps allegedly being vulnerable due to an SSL bug in AFNetworking. These articles contain a number of inaccurate and misleading statements on this matter.

We are publishing this response to clarify and correct these statements.

Background Information

For those not familiar with AFNetworking, here are some relevant details about the library for this story:

  • AFNetworking is an open source, third-party library that provides convenience functionality on top of Apple's built-in frameworks.
  • One component of AFNetworking is AFSecurityPolicy, which handles authentication challenges according to a policy configured by the application. This includes the evaluation of X.509 certificates which servers send back when connecting over HTTPS.
@krzyzanowskim
krzyzanowskim / define_for_all_pods
Last active March 26, 2020 09:42
Disable NSLog with all CocoaPods with post_install hook.
post_install do | installer |
print "Updating #{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h\n"
open("#{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h","a") do |file|
file.puts <<EOF
// Disable logs
#ifndef DEBUG
#define NSLog(...)
#endif
EOF
end
@idy
idy / re-sign-ipa.sh
Created December 9, 2014 06:56
Use codesign re-sign swift app
#!/bin/sh
# Usage: ./sign.sh INPUT.ipa OUTPUT PROVISION.mobileprovision IDENTITY_NAME ENTITLEMENTS
# Reading parameters
INPUT=$1
OUTPUT=$2.ipa
MOBILE_PROVISTION=$3
CER_NAME=$4
# ENTITLEMENTS=$5
@krzysztofzablocki
krzysztofzablocki / gist:4396302
Last active November 24, 2021 19:17
Set symbol breakpoint on objc_msgSend then setup this debug command to log all methods called in iOS Simulator. If you want to do device debugging change esp+4 register to r0, esp+8 to r1 Found long ago somewhere on stackoverflow.
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )

Salary Negotiation Strategies

Meetup at Runway.js, Feb 27, 2018

The Panel

  • Mabel Chan, Co-founder, Albert's List
  • Artur Meyster, Founder, Breaking into Startups
  • Erin Wilson, Co-founder, Talent Engineer, Hirepool.io
  • Abbie Isidro, Creative and Marketing Recruiter - Beauty, Aquent
  • Noah Wisna, Head of Talent and Operations, 10 x 10
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@Ashton-W
Ashton-W / Breakpoints_v2.xcbkptlist
Last active January 25, 2023 09:28
My User Breakpoints_v2.xcbkptlist
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<!-- All Exceptions -->
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent