This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get("/allSurgun", isAuth, function(req, res) { | |
User.findOne({ _id: req.decoded }, function(err, user) { | |
if (err) throw err; | |
if (!user) | |
res.status(400).json({ | |
success: false, | |
data: "Kullanıcı bulunamadı!" | |
}); | |
//If have a user. | |
Surgun.find({ _id: { $in: user.surgun } }, function(err, surgunData) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeSomething(a, callback){ | |
callback(a); | |
} | |
makeSomething(3,function(value){ | |
console.log("value --> "+value); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I added this | |
<preference name="BackgroundColor" value="0x00000000" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a request interceptor | |
axios.interceptors.request.use(function (config) { | |
// Do something before request is sent | |
return config; | |
}, function (error) { | |
// Do something with request error | |
return Promise.reject(error); | |
}); | |
// Add a response interceptor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetAuth2Token(device) { | |
return new Promise(function(resolve, reject) { | |
QRC.setTargetIpAddress(device.ip, device.index); | |
QRC.getToken(vm.current_password ||'12345678', device.index).then(sucFn); | |
function sucFn(data) { | |
QRC.setTargetAuthToken(data.data.access_token); | |
resolve (data.data.access_token); | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data={ foo:"bar"}; | |
var xhttp = new XMLHttpRequest(); | |
xhttp.onreadystatechange = function() { | |
if (this.readyState == 4 && this.status == 200) { | |
console.log("OK"); | |
} | |
}; | |
xhttp.open("POST", "http://localhost:8080", true); | |
xhttp.setRequestHeader("Content-type", "application/json"); | |
xhttp.send(JSON.stringify(data)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AppNavigator } from '../route'; | |
import { NavigationActions } from 'react-navigation'; | |
export function nav(state = null, action) { | |
let nextState; | |
switch (action.type) { | |
case 'Login': | |
nextState = AppNavigator.router.getStateForAction(NavigationActions.back(), state); | |
break; | |
case 'Logout': | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/** | |
* Module dependencies. | |
*/ | |
var app = require('./app'); | |
var debug = require('debug')('fittechsapi:server'); | |
var http = require('http'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Write some awesome Swift code, or import libraries like "Foundation", | |
// "Dispatch", or "Glibc" | |
import Foundation | |
extension String | |
{ | |
func trim() -> String |