Skip to content

Instantly share code, notes, and snippets.

View 0x8badf00d's full-sized avatar

0x8badf00d 0x8badf00d

View GitHub Profile

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@0x8badf00d
0x8badf00d / FrequencyCounter.m
Created September 13, 2015 18:29
Program to count frequency of a word in sentence. (Stripping any
#import <Foundation/Foundation.h>
void frequencyCounterOfWordsInSentence(NSString *sentence)
{
NSArray *words = [sentence componentsSeparatedByString:@" "];
NSMutableDictionary *wordCounterDict = [NSMutableDictionary dictionary];
for(NSString *word in words)
{
// Remove any characters from word which is not from letter character set
NSString *scrubbedWord = [[word componentsSeparatedByCharactersInSet:[[NSCharacterSet letterCharacterSet] invertedSet]] componentsJoinedByString:@""];
@0x8badf00d
0x8badf00d / wwdc15.md
Last active August 29, 2015 14:24 — forked from mackuba/wwdc15.md

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
/*
* This is an example provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@0x8badf00d
0x8badf00d / codesign.sh
Last active August 29, 2015 14:22
Script to codesign app
# Script to codesign ipa with AdHoc or distribution certificate
# Execute script from the folder you have provisioning profile you want to be embedded with the IPA and name it as embedded.mobileprovision
#
# To change the bundle identifier pass it as argument to this script first argument is taken as bundle identifier, if more than one arguments are passed then its ignored
# usage script.sh com.appid.bundleid 1.2 45 FinalIPAName
echo "Start the codesigning the app"
mv *.ipa testapp.zip # Rename ipa file to .zip
tar -xf testapp.zip # unzip the file to reveal Payload folder
cd Payload/*.app/ # Go to Payload folder then into .app folder
@0x8badf00d
0x8badf00d / gist:83e9c7ad92cf1e2a9b95
Created October 23, 2014 03:10
Google Interview Prep
1) Algorithm Complexity - Big-O
2) Sorting - Merge, Insert, Bubble
3) Hashtables - Implement using Arrays
4) Trees - Binary, n-ary, trie-trees; balanced binary tree - Red/Black tree, splay tree, AVL tree
Tree traversal algorithm - BFS, DFS ; difference between inorder, postorder, preorder
5) Graphs - Representation of graphs using: objects and pointers, matrix, adjacency list
Graph traversal algorithm - BFS, DFS
A* and Dijkstra
6) Data Structures - NP-complete problems: traveling salesman and knapsack problem
7) Discrete Mathematics - combinatorics and probability
@0x8badf00d
0x8badf00d / gist:4e960e5d1e6b5aa08464
Created August 30, 2014 20:42
Mobile Conference Videos
@0x8badf00d
0x8badf00d / Jailbreak
Last active September 4, 2016 04:34
Inspect view hierarchy and Decrypt binaries
Decrypt Binaries from AppStore IPA
-----------------------------------
* `Cydia` - Add Source - http://cydia.iphonecake.com/
* `Mobile Terminal` - login root - Clutch - Clutch <appname>
* `/var/root/` - Location for Decrypted files
* `Class-dump` - `./class-dump -H <location-of-binary> -o <location-to-save-header-files>` To dump all headers
Inspect View-Hierarchy of Apps
------------------------------
* CyDelete - Install CyDelete from Cydia if MobileSubstrate folder is not listed in /Library/.
[
{
"itemId": "123456",
"definingAttributes": [
{
"attributeName": "Product Length (in.)",
"attributeValue": "10"
},
{
"attributeName": "Product Width (in.)",
@0x8badf00d
0x8badf00d / CodeTest.c
Created May 16, 2014 14:41
Write function if the input number is 2 return 1, if the input number is 1 then return 2
int usingSubtraction(int x)
{
return 3-x;
}
int usingDivision(int x)
{
return 2/x;
}