Skip to content

Instantly share code, notes, and snippets.

@hadibadjian
hadibadjian / command.sh
Last active July 5, 2022 00:11
Rebuilding the Spotlight index
#!/bin/bash
# Reference: https://ss64.com/osx/mdutil.html
sudo mdutil -E /
@hadibadjian
hadibadjian / README.md
Last active August 16, 2019 09:20
iOS - Symbolicate crashlogs

[Symbolicate crashlogs with Xcode 9 and Bitcode][1]

  • Create a folder
  • Place the DSYM file in the folder. (unzip file.dsym.zip)
  • Place the crash log in the folder.
  • Run the following commands to symbolicate the crash log.
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
cp -i /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash ./
@hadibadjian
hadibadjian / README.md
Last active May 19, 2020 02:50
Firefox 57+ Treestyle Tab

Firefox users who want to hide the tab bar at this point in time may add the following line to the userChrome.css file in the /chrome/ directory of the Firefox profile to do so:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* to hide the native tabs */
#TabsToolbar {
    visibility: collapse;
}
@hadibadjian
hadibadjian / Gemfile
Last active October 29, 2017 14:45
MacOS PostgreSQL Setup
gem 'pg'
@hadibadjian
hadibadjian / README.md
Last active June 20, 2017 01:49
Output git diff to HTML

Prerequisites

  • wget
  • gawk

You may install them using Homebrew:

brew install wget gawk

Steps

@hadibadjian
hadibadjian / pre-request-script.js
Last active September 16, 2020 08:59
Postman HMAC Authorization
// inspired by https://gist.github.com/DinoChiesa/75796b27828cf8e15c91
function calculateHMAC(config, messageDictionary) {
var template = 'AppAuth method=${algorithm} applicationId=${applicationId} signature=${signature}';
var hashf = (function() {
switch (config.algorithm) {
case 'HMAC-SHA1': return CryptoJS.HmacSHA1;
case 'HMAC-SHA256': return CryptoJS.HmacSHA256;
case 'HMAC-SHA512': return CryptoJS.HmacSHA512;
default : return null;
@hadibadjian
hadibadjian / xcode-build-settings.md
Created June 27, 2016 01:27
Xcode Build Settings

Use the following command to generate Xcode build settings and configurations for a given target:

xcodebuild -project example.xcodeproj -target "Example" -showBuildSettings
@hadibadjian
hadibadjian / README.md
Created April 23, 2016 01:58
Change Xcode File Templates

Navigate to /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates and modify ___FILEBASENAME___.x accordingly.

@hadibadjian
hadibadjian / README.md
Created April 9, 2016 09:22
Setting up API stubs using mockbin on MacOS

Installation

brew install redis

brew install npm

npm install mockbin

Configuration

@hadibadjian
hadibadjian / README.md
Last active January 4, 2016 04:49
Managing Multiple SSH Keys

Preparation

  • Create different SSH Keys for each account. A simple SSH key can be generated using ssh-keygen -t rsa -C 'email@example.com'
  • Create a blank config file and include host details as in provided example file. Add an indentifier to differentiate hosts for similar host names.

Tree structure of ~/.ssh folder

/Users/hadi/.ssh/
├── config
├── id_rsa_example_enterprise
├── id_rsa_example_enterprise.pub