Skip to content

Instantly share code, notes, and snippets.

View pouriaalmassi's full-sized avatar

Pouria Almassi pouriaalmassi

View GitHub Profile
@pouriaalmassi
pouriaalmassi / xcode-sublime-keybinding.txt
Last active February 4, 2022 06:38
Xcode keybindings for Sublime Text
[
{ "keys": ["alt+super+["], "command": "swap_line_up" },
{ "keys": ["alt+super+]"], "command": "swap_line_down" },
{ "keys": ["ctrl+i"], "command": "reindent", "args": {"single_line": false}},
{ "keys": ["alt+0"], "command": "toggle_side_bar" },
{ "keys": ["super+alt+left"], "command": "fold" },
{ "keys": ["super+alt+right"], "command": "unfold" },
{ "keys": ["alt+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["alt+shift+j"], "command": "reveal_in_side_bar"},
{ "keys": ["alt+shift+o"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
@pouriaalmassi
pouriaalmassi / gist:34d74101e4f31e812988c16790449fe0
Created November 9, 2019 00:28
Random Swift image placeholder URL.
extension URL {
/// Use `let url = URL.placeholderImageUrl`
static var placeholderImageUrl: URL? {
let size = Int.random(in: 150..<800)
return placeholderImageUrl(with: CGSize(width: size, height: size))
}
/// Use `let url = URL.placeholderImageUrl(with: CGSize(width: 200, height: 200))`
static func placeholderImageUrl(with size: CGSize) -> URL? {
let services = [
@pouriaalmassi
pouriaalmassi / reddit-hide-username.css
Created February 25, 2019 02:32
A CSS snippet to hide a Reddit user's username.
/* Hide Reddit username new design (2018-) */
div[class*="s1ilcdod-18 dsBbYg"] {
visibility: hidden;
}
/* Hide Reddit username old design (pre-2018) */
span[class="user"] {
visibility: hidden !important;
}
// Swift 2.2
// Xcode Version 7.3 (7D175)
// 1
do {
try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil)
} catch {
var dict = [String: AnyObject]()
// Build warning:
# install class-dump
brew install class-dump
# dump the frameworks you're interested in
class-dump -H -o UIKit /Applications/Xcode5-DP.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework
class-dump -H -o SpringBoardUI /Applications/Xcode5-DP.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/PrivateFrameworks/SpringBoardUI.framework
@pouriaalmassi
pouriaalmassi / gist:31de187cc5fc67eeb570
Created February 18, 2015 02:01
NSURLSession in a Playground
// Playground - noun: a place where people can play
import UIKit
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true)
let path = "http://www.reddit.com/r/simpleios.json"
let session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
let url = NSURL(string: path)
@pouriaalmassi
pouriaalmassi / gist:814bbd7f06a9106ca7a1
Last active November 6, 2016 09:27
AppStore Management and Marketing

AppStore Management and Marketing

Resources outside of the software development process: submission, reviewing sales, marketing, etc.

How to Submit to the store?
Management of an App
@pouriaalmassi
pouriaalmassi / gist:04a1d9dc514f7ab7a89d
Last active August 29, 2015 14:14
Design and Prototyping

Design and Prototyping

  • .CLR files ~/Library/Colors
Color
Design Assets
  • Prepo - Generate all icon sizes from an original.
  • Glyphicons - library of precisely prepared monochromatic icons and symbols
@pouriaalmassi
pouriaalmassi / gist:5883db33ac2ee679e69f
Last active November 6, 2016 09:26
Swift Resources

Swift Resources

Resources from Apple