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
@yusuke024
yusuke024 / ViewController.swift
Created November 16, 2018 03:15
Recording video with AVAssetWriter
import UIKit
import AVFoundation
class ViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
switch AVCaptureDevice.authorizationStatus(for: .video) {
case .notDetermined:
@sam016
sam016 / AllGattCharacteristics.java
Last active April 19, 2024 23:54
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@chrismllr
chrismllr / withNavigationHandlers.js
Created October 30, 2017 20:01
react-native-navigation: navigation handler HOC
/* Usage
const navigationHandlers = [
{
predicate: props => props.currentUser.isAuthenticated === false,
handler: navigator => {
navigator.resetTo({
screen: LOGIN_SCREEN,
animationType: 'fade'
});
}
@iremlopsum
iremlopsum / WaitForUI.js
Last active December 19, 2020 22:24
InteractionManager example
import React, { PureComponent } from 'react';
import { InteractionManager } from 'react-native';
class WaitForUI extends PureComponent {
constructor(props) {
super(props);
this.state = {
interactionsComplete: false,
};
}
@joshdholtz
joshdholtz / .env
Last active December 26, 2023 13:31
Using Dotenv and environment variables with fastlane
STUFF = this is some stuff
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active April 11, 2024 15:02
React Native Bridging Cheatsheet
@scottopell
scottopell / fix_exfat_drive.md
Last active March 9, 2024 12:08
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?
@haocong
haocong / karatsuba.js
Last active December 22, 2018 19:53
Karatsuba Multiplication in JavaScript
/**
* Karatsuba Multiplication
* @param {Number} x - first number
* @param {Number} y - second number
* @return {Number} Multiply of x and y
*/
function karatsubaMulti(x, y) {
let n = Math.min(('' + x).length, ('' + y).length);
@flpwgr
flpwgr / 030_modify_plist.sh
Created September 15, 2015 14:44
Cordova Hook for App Transport Security iOS 9
#!/bin/bash
PLIST=platforms/ios/*/*-Info.plist
cat << EOF |
Add :NSAppTransportSecurity dict
Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool YES
EOF
while read line
do
@justin-nodeboy
justin-nodeboy / api.js
Last active September 9, 2015 07:13
A simple API function for calling an endpoint in Titanium, see demo.js for usage
/**
Use this function to make calls to a JSON REST API see demo.js for useage
@param options
@param end (Callback)
**/
exports.api = function(options, end) {
//This function makes calls to an Endpoint and then sends the data back via callback to the function that requested it.
//Alloy.CFG.conn_url is set in your config.json file and can be accessed depending on which environment you are using.
var method = options.method,