Skip to content

Instantly share code, notes, and snippets.

View deya-eldeen's full-sized avatar

Deya Eldeen Elkhawaldeh deya-eldeen

View GitHub Profile
import Foundation
public func print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
#if DEBUG
let output = items.map { "\n⚠️ YourAppName \($0)" }.joined(separator: separator)
Swift.print(output, terminator: terminator)
#else
if(Environment.allowPrint == "1"){
let output = items.map { "\n⚠️ YourAppName \($0)" }.joined(separator: separator)
Swift.print(output, terminator: terminator)
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 7, 2024 17:59
Files for PlayStation BIOS Files NA-EU-JP
@mehmetfarhan
mehmetfarhan / CaptureList.swift
Created September 25, 2020 11:18
Capture List
import UIKit
final class Increment {
// MARK: - Properties
private var number: Int = 0
// MARK: - This will cause memory leak
// lazy var incrementNumber: (Int) -> Void = { value in
@abhi21git
abhi21git / ExtensionURLRequest.swift
Last active February 19, 2024 12:23
Swift cURL Printer
//
// ExtensionURLRequest.swift
//
// Created by Abhishek Maurya on 16/07/20.
// Copyright © 2020. All rights reserved.
//
import Foundation
extension URLRequest {
@patriknyblad
patriknyblad / xcrun_simctl_cheatsheet.md
Last active May 6, 2024 07:01
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active June 24, 2023 07:38
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@vinovator
vinovator / UdacityDownload.py
Last active July 28, 2023 05:03
Python program to download course content for multiple Udacity courses neatly arranged within a folder structure
# UdacityDownload.py
# Python 2.7.6
"""
Python script to download course content from udacity courses
- Creates folders as per course names
- Downloads all the zip files
- Extract content from zip file
- Finally delete the zip file
Multiple course content can be downloaded from list
@wosephjeber
wosephjeber / ngrok-installation.md
Last active May 6, 2024 20:19
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

@somandubey
somandubey / gist:52bff8c7cc8639292629
Created August 28, 2014 19:56
How to increase ulimit in Linux

How to increase ulimit in Linux:

  • Step 1 (ulimit): open the sysctl.conf and add this line fs.file-max = 65536

      vi /etc/sysctl.conf   
    

    add following at end of file in above file:

      fs.file-max = 65536
    

save and exit.

@JeOam
JeOam / NSZombieEnabled.md
Created July 8, 2014 02:05
NSZombieEnabled

NSZombieEnabled is an environment variable which controls whether the Foundation runtime will use zombies. When zombies are enabled, a deallocated object's class is dynamically changed to be _NSZombie, and by default, the memory region is never marked as free, although this can be controlled separately(so, remember to disable NSZombieEnabled for Archived Release Build).

The end result is that, with zombies enabled, messages to deallocated objects will no longer behave strangely or crash in difficult-to-understand ways, but will instead log a message and die in a predictable and debugger-breakpointable way. This is the tool to use when trying to track down over-releases and premature releases.

Zombies will take effect for all Objective-C objects that are deallocated through normal means, including most Cocoa classes as well as user-created classes. On 10.4 and earlier, a rather important exception to this is most/all TollFreeBridged classes, as they are deallocated using CoreFoundation which NSZombieEnab