Skip to content

Instantly share code, notes, and snippets.

View ThasianX's full-sized avatar
🚀
Greatness is coming

Kevin ThasianX

🚀
Greatness is coming
View GitHub Profile
@ebaker355
ebaker355 / LocalizeStringsFromAndroid.rb
Created July 31, 2012 14:41
Translate Android strings.xml files to iOS Localizable.strings files
#!/usr/bin/env ruby
# gist: https://gist.github.com/3217498
# This script can be called from an Xcode 'Run Script' build phase at the
# beginning of the build process, like this:
#
# ${PROJECT_DIR}/LocalizeStringsFromAndroid.rb ${PROJECT_NAME}
#
# This script should be placed in the same directory as your .xcodeproj
@staltz
staltz / introrx.md
Last active May 29, 2024 05:51
The introduction to Reactive Programming you've been missing
@kristopherjohnson
kristopherjohnson / XcodeAutogeneratedFileHeaderCommentRegularExpression.txt
Created September 11, 2014 00:53
Regular expression that matches the file header comment that Xcode automatically generates
//
// .*
// .*
//
// Created by .*
// Copyright .*
//
@gurgeous
gurgeous / CGMath.swift
Last active April 13, 2021 15:52
missing operators for CGPoint, CGSize and CGRect
//
// MARK: CGPoint op point/size/float
//
func -(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x - r.x, y: l.y - r.y) }
func +(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x + r.x, y: l.y + r.y) }
func *(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x * r.x, y: l.y * r.y) }
func /(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x / r.x, y: l.y / r.y) }
func -(l: CGPoint, r: CGSize) -> CGPoint { return CGPoint(x: l.x - r.width, y: l.y - r.height) }
@AliSoftware
AliSoftware / struct_vs_inheritance.swift
Last active March 27, 2024 11:57
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 28, 2024 08:25
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@tsaqib
tsaqib / ideas.md
Last active April 14, 2024 12:48
Ideas that you can use for hackathons, competitions and research.

Ideas

I have collected and moderated these ideas from various public sources and put into one place so that problem solvers and solution developers may find inspirations. Because I wish to update it regularly, I have setup as a single page wiki. You may try these ideas on hackathons/competitions/research; some are quite intense problems and some are not. Many of the problems were prepared keeping Dhaka/Bangladesh in mind, but of course can be applied to just about any underdeveloped/developing and sometimes developed countries.

Categories:
  • Eradicate Extreme Poverty and Hunger
  • Education
  • Healthcare
  • Governance

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@zacwest
zacwest / ios-font-sizes.swift
Last active May 17, 2024 10:24
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@briancroom
briancroom / Swift.md
Last active February 6, 2024 18:26
How to create a Swift modular library

I am trying to determine if it is possible to build a Swift dynamic library which is itself composed of one of more private modules, without needing to expose to that fact to outside users. My hope was that I could build the private module as a static library, which would be linked into the primary (dynamic) library. The dylib could then be deployed together with its swiftmodule and swiftdoc and be imported, with the private module and its symbols not being exposed at all.

Unfortunately, what I'm currently observing seems to indicate that the private module's swiftmodule also has to be available for the primary library to be successfully imported.

This can be reproduced as follows. I have the following directory structure:

./Greeter/Logger/Logger.swift:

public func log(_ message: String) {