Skip to content

Instantly share code, notes, and snippets.

View nazrdogan's full-sized avatar
🎯
Busy

Nazır Doğan nazrdogan

🎯
Busy
View GitHub Profile
@nazrdogan
nazrdogan / fix_exfat_drive.md
Created February 14, 2019 19:55 — forked from scottopell/fix_exfat_drive.md
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
nazrdogan / _verify-repair-permissions-disk.md
Created November 24, 2017 14:48 — forked from bzerangue/_verify-repair-permissions-disk.md
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
nazrdogan / Object Flatten
Created June 16, 2017 15:34 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
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
nazrdogan / gist:a869fe1b3acf76b2166b7ed17b116601
Created July 29, 2016 19:07 — forked from Skoua/gist:5927652
Add route to an Apple Map using Google Maps Directions API in Titanium (Alloy).
// 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
nazrdogan / titanium logcat
Last active May 20, 2016 09:23 — forked from ricardoalcocer/text
When doing console.log on Android, get the output on the Terminal.
The ADB excecutable lives in:
[path-to-android-sdk]/platform-tools/
./adb -e logcat | grep TiAPI
or
./adb -d logcat | grep TiAPI
@nazrdogan
nazrdogan / ALLOY.md
Created April 8, 2016 07:41 — forked from FokkeZB/ALLOY.md
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
nazrdogan / camera-overlay
Created April 1, 2016 19:01 — forked from clathrop/camera-overlay
Titanium: Using a camera overlay and saving images to internal storage
var win = Titanium.UI.createWindow();
var scanner = Titanium.UI.createView({
width : 260,
height : 200,
borderColor : 'red',
borderWidth : 5,
borderRadius : 15
});
@nazrdogan
nazrdogan / gist.md
Created March 2, 2016 21:19 — forked from benbalter/gist.md
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 %}.

@nazrdogan
nazrdogan / sticky-table-headerview.js
Created December 21, 2015 13:38 — forked from tzmartin/sticky-table-headerview.js
Titanium Sticky Header
// just a quick n dirty test. See result: http://monosnap.com/file/wT6dJZ4zOrHzjiXi1mhfnIocEZiAWW
var headerView = Ti.UI.createView({
backgroundColor:'#fff',
height:80,
layout:'horizontal'
});
headerView.add(Ti.UI.createButton({title:'$100',left:20,top:13,height:50,width:80,backgroundColor:'#ca3943',borderRadius:4,color:'#fff'}));
headerView.add(Ti.UI.createButton({title:'$500',left:20,top:13,height:50,width:80,backgroundColor:'#ca3943',borderRadius:4,color:'#fff'}));
@nazrdogan
nazrdogan / README.md
Last active August 29, 2015 14:26 — forked from FokkeZB/README.md
How to have a dynamic Android menu or action bar for tab groups in Titanium 3.x?