Skip to content

Instantly share code, notes, and snippets.

View milanpanchal's full-sized avatar
🏠
Working from home

Milan Panchal milanpanchal

🏠
Working from home
View GitHub Profile
@milanpanchal
milanpanchal / Xcode 12 Excluded Architectures for arm64
Created December 14, 2020 06:13
Xcode 12, building for iOS Simulator, but linking in object file built for iOS, file for architecture arm64
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
@milanpanchal
milanpanchal / github-emoji.md
Created April 26, 2022 14:09 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@milanpanchal
milanpanchal / get-medium-stats.js
Created April 14, 2022 05:41 — forked from igeligel/get-medium-stats.js
medium-get-totals
const totalTypes = {
VIEWS: 2,
READS: 3,
FANS: 5
};
const getTotal = tableColumn =>
[
...document.querySelectorAll(
`td:nth-child(${tableColumn}) > span.sortableTable-number`
@milanpanchal
milanpanchal / GroupingArrayUsingDictionary.swift
Last active April 5, 2021 15:56
To group an array according to some criteria in Swift
// https://medium.com/@milanpanchal24/how-to-group-array-using-dictionary-in-swift-6d185c8c79c
let fruits = ["Apple", "Apricot", "Avocado",
"Banana", "Boysenberry", "Blueberry", "Bing Cherry",
"Clementine", "Cucumber",
"Dates", "Dewberries", "Dragon Fruit"]
let groupedByAlphabet = Dictionary(grouping: fruits) { $0.first! }
@milanpanchal
milanpanchal / GroupingArrayUsingDictionaryInSwift-example2.swift
Last active April 5, 2021 15:56
To group an array by countryName in swift
// https://medium.com/@milanpanchal24/how-to-group-array-using-dictionary-in-swift-6d185c8c79c
let employee = [["countryName":"India", "name":"Milan", "age":"30"],
["countryName":"India", "name":"Emma", "age":"25"],
["countryName":"NZ", "name":"Olivia", "age":"40"],
["countryName":"NZ", "name":"Sophia", "age":"22"],
["countryName":"Canada", "name":"David", "age":"33"],
["countryName":"Canada", "name":"Wyatt", "age":"21"],
["countryName":"Portugal", "name":"Joseph", "age":"28"]]
@milanpanchal
milanpanchal / StudentSortedByAddressAndAge.swift
Last active March 17, 2021 08:16
2_How to Sort by Multiple Properties in Swift?
let sortedByAddressAndAge = Student.students.sorted {
if $0.address == $1.address {
return $0.age < $1.age
}
return $0.address < $1.address
}
/* Output:
@milanpanchal
milanpanchal / Xcode 12 Build Active Architecture Only
Created December 14, 2020 06:44
Xcode 12 Build Active Architecture Only
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
end
end
end
@milanpanchal
milanpanchal / Close All Notifications On Mac OS X
Last active November 17, 2020 21:07
Clearing All Notifications in Mac OS X through Apples Automator App by writing JavaScript Code
// https://medium.com/@milanpanchal24/clearing-all-notifications-in-mac-os-x-3be0a16eb2a3
function run(input, parameters) {
var app = Application('System Events');
app.includeStandardAdditions = true;
app.processes.byName('NotificationCenter').windows.buttons[0].click();
return input;
}
@milanpanchal
milanpanchal / .swiftlint.yml
Last active September 11, 2020 14:02
Swift Lint Configuration file
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji)
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
disabled_rules: # rule identifiers to exclude from running
- trailing_whitespace
- force_cast
- force_unwrapping
@milanpanchal
milanpanchal / app.py
Created June 4, 2020 06:55
Check which countries an app is available in on AppStore
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import json
import sys
countrydict = {
'AE': 'United Arab Emirates',
'AG': 'Antigua and Barbuda',