Skip to content

Instantly share code, notes, and snippets.

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

Mokhlas Hussein iMokhles

🏠
Working from home
View GitHub Profile
#!/bin/bash
PLATFORM=iPhoneOS # iPhoneSimulator # iPhoneOS
HOST=arm-apple-darwin # i386-apple-darwin10 # arm-apple-darwin10
ARCH=arm64 # i386 # armv7s #armv7
SDK_VERSION=13.0
XCODE_ROOT=`xcode-select -print-path`
PLATFORM_PATH=$XCODE_ROOT/Platforms/$PLATFORM.platform/Developer
SDK_PATH=$PLATFORM_PATH/SDKs/$PLATFORM$SDK_VERSION.sdk
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active July 25, 2024 19:20
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@rpetrich
rpetrich / BioLockdown.h
Created August 2, 2015 21:22
BioLockdown API
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
@class SBApplication, CKConversation;
__attribute__((visibility("hidden")))
@interface BioLockdownController : NSObject
+ (BioLockdownController *)sharedController;
@iMokhles
iMokhles / How to open iOS application from WatchKit
Created April 21, 2015 18:49
is a simple trick to open iOS application and even a page within the application from WatchKit
/*
//
// How to open iOS application using WatchKit
//
// Created by Mokhlas Hussein on 09/04/15.
// Copyright (c) 2015 iMokhles (Mokhlas Hussein). All rights reserved.
//
*/
/******* Within the App Watch Extension *******/
//
// UIViewExtensions.swift
// Singles
//
// Created by Cory D. Wiles on 2/19/15.
// Copyright (c) 2015 Cory WIles. All rights reserved.
//
import UIKit
@iMokhles
iMokhles / How to use the old prefs method within sandbox apps
Last active August 29, 2015 14:14
How to use the old prefs method within sandbox apps
static BOOL tweakEnabled = NO;
static void PreferencesChangedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
system("killall WhatsApp"); // kill app to apply changes ;)
NSDictionary *preferences = [[NSDictionary alloc] initWithContentsOfFile:@"TWEAK_PREFS_PATH"];
tweakEnabled = [preferences[@"tweakEnabled"] boolValue];
}
%ctor {
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *block) {
@iMokhles
iMokhles / CFPreferencesAppSynchronize with ARC and non ARC.xm
Last active August 16, 2020 13:28
How to use CFPreferencesAppSynchronize with ARC and non ARC (iOS8 Tweaks) + CFNotificationCallback (option) Works fine with Sandbox Apps
static BOOL tweakEnBOOL;
#define SETTINGSFILENEW "com.imokhles.Prefs"
#define PREFERENCES_CHANGED_NOTIFICATION "com.imokhles.Prefs.preferences-changed"
// non ARC
static void iMoLoadPreferences() {
CFPreferencesAppSynchronize(CFSTR(SETTINGSFILENEW));
tweakEnBOOL = !CFPreferencesCopyAppValue(CFSTR("Enabled"), CFSTR(SETTINGSFILENEW)) ? YES : [(id)CFBridgingRelease(CFPreferencesCopyAppValue(CFSTR("Enabled"), CFSTR(SETTINGSFILENEW))) boolValue];
}
@iMokhles
iMokhles / TheosOnCygwin
Last active June 27, 2016 21:27
Change Logs, - First Release - Platform .mk file if you have any quiz just follow me on twitter @iMokhles And mail me : imokhles@imokhles.com
This is my first .mk files to get theos work and compile tweaks through Cygwin,
@kkirsche
kkirsche / Install Composer to use MAMP's PHP.md
Last active January 30, 2024 02:30
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@kirb
kirb / README.md
Last active October 10, 2015 18:17
Theos on Windows