Skip to content

Instantly share code, notes, and snippets.


Nazır Doğan nazrdogan

View GitHub Profile
nazrdogan /
Created Feb 14, 2019 — forked from scottopell/
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
nazrdogan /
Created Nov 24, 2017 — forked from bzerangue/
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

nazrdogan / Object Flatten
Created Jun 16, 2017 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
View Object Flatten
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
nazrdogan / gist:a869fe1b3acf76b2166b7ed17b116601
Created Jul 29, 2016 — forked from Skoua/gist:5927652
Add route to an Apple Map using Google Maps Directions API in Titanium (Alloy).
View gist:a869fe1b3acf76b2166b7ed17b116601
// setup geolocation purpose and accuracy
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.purpose = L('geo-purpose');
// setup map and poi's annotation
var latitude = 48.847684,
longitude = 2.35165;
var annotation = Titanium.Map.createAnnotation({
animate: true,
nazrdogan / titanium logcat
Last active May 20, 2016 — forked from ricardoalcocer/text
When doing console.log on Android, get the output on the Terminal.
View titanium logcat
The ADB excecutable lives in:
./adb -e logcat | grep TiAPI
./adb -d logcat | grep TiAPI
nazrdogan /
Created Apr 8, 2016 — forked from FokkeZB/
Alloy constants and helpers for non-Alloy Titanium projects.

If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.

Well, you can:

var _ = require((typeof ENV_TEST === 'boolean') ? 'alloy' : 'underscore')._;

The above works by utilizing Alloy's optimization process. In this process, constants like ENV_TEST will be either TRUE or FALSE. The actual expressions in wich they are used will then be evaluated. If FALSE the code block will be removed. In plain Titanium projects the constants are undefined and this typeof ENV_TEST will be undefined, so the code block will be executed.

nazrdogan / camera-overlay
Created Apr 1, 2016 — forked from clathrop/camera-overlay
Titanium: Using a camera overlay and saving images to internal storage
View camera-overlay
var win = Titanium.UI.createWindow();
var scanner = Titanium.UI.createView({
width : 260,
height : 200,
borderColor : 'red',
borderWidth : 5,
borderRadius : 15
nazrdogan /
Created Mar 2, 2016 — forked from benbalter/
Example of how to embed a Gist on GitHub Pages using Jekyll.

Here's an example of how to embed a Gist on GitHub Pages:

{% gist 5555251 %}

All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.

View sticky-table-headerview.js
// just a quick n dirty test. See result:
var headerView = Ti.UI.createView({
nazrdogan /
Last active Aug 29, 2015 — forked from FokkeZB/
How to have a dynamic Android menu or action bar for tab groups in Titanium 3.x?
You can’t perform that action at this time.