Skip to content

Instantly share code, notes, and snippets.

🎯
Busy

Nazır Doğan nazrdogan

🎯
Busy
Block or report user

Report or block nazrdogan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chrismllr
chrismllr / withNavigationHandlers.js
Created Oct 30, 2017
react-native-navigation: navigation handler HOC
View withNavigationHandlers.js
/* Usage
const navigationHandlers = [
{
predicate: props => props.currentUser.isAuthenticated === false,
handler: navigator => {
navigator.resetTo({
screen: LOGIN_SCREEN,
animationType: 'fade'
});
}
@scottopell
scottopell / fix_exfat_drive.md
Last active Nov 20, 2019
Fix corrupted exFAT disk macOS/OSX
View fix_exfat_drive.md

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 Dec 22, 2018
Karatsuba Multiplication in JavaScript
View karatsuba.js
/**
* 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 Sep 15, 2015
Cordova Hook for App Transport Security iOS 9
View 030_modify_plist.sh
#!/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 Sep 9, 2015
A simple API function for calling an endpoint in Titanium, see demo.js for usage
View api.js
/**
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,
@harshil93
harshil93 / SampleModel.js
Created Jun 8, 2015
Retrieving / Getting the current user id in a remote method in strongloop's loopback framework.
View SampleModel.js
var loopback = require('loopback');
module.exports = function(SampleModel) {
// Returns null if the access token is not valid
function getCurrentUserId() {
var ctx = loopback.getCurrentContext();
var accessToken = ctx && ctx.get('accessToken');
var userId = accessToken && accessToken.userId;
return userId;
@FokkeZB
FokkeZB / !README.md
Last active Apr 13, 2016
Facebook's css-layout for Titanium
View !README.md

Facebook's css-layout for Titanium

Exploring how it could be used to have a more iOS-autolayout-like layout system on Titanium.

Getting the script to work

  1. Put Layout.js in app/lib.
  2. Put the below computeLayout.js in app/lib to fix this.
  3. Use the below alloy.js and confirm it to work.
View sticky-table-headerview.js
// 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'}));
@RLTmultimedia
RLTmultimedia / readme.txt
Created Apr 7, 2014
Create route in titanium map module
View readme.txt
Create a file in your lib folder, like **rootproject**/lib/routes.map.js
load the module in your file and initialize with the data:
var jsonCoordinates = {
'destination': dest.latitude + ',' + dest.longitude,
'origin': origin.latitude + ',' + origin.longitude,
};
var routes = require("routes.map")(jsonCoordinates, mapview);
View cocos2d-x-icon-generator.py
# -*- coding: utf-8 -*-
#
# cocos2d-x-icon-generator.py
# created by giginet on 2014/02/27
#
import sys
from PIL import Image
SIZES = (
(29, 29),
(40, 40),
You can’t perform that action at this time.