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
export const BIRTH_SUCCESS = 'BIRTH_SUCCESS'; | |
export const birthSuccess = (births) => ({ | |
type: BIRTH_SUCCESS, | |
payload: { births }, | |
}); | |
export const loadBirths = (page) => async (dispatch) => { | |
const response = await request('/certificates/birth/page/', dispatch, page); | |
if (response) { |
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
// responses | |
export const SuccessResponse = function(res,data) { | |
if(data){ | |
res.json(data) | |
}else{ | |
ErrorResponse(res,{message:'Data is null',code:422}) | |
} | |
} | |
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
private fun startDropMarkerAnimation(marker: Marker) { | |
val target = marker.position | |
val handler = Handler() | |
val start = SystemClock.uptimeMillis() | |
val proj = mMap!!.projection | |
val targetPoint = proj.toScreenLocation(target) | |
val duration = (200 + targetPoint.y * 0.6) as Double | |
val startPoint = proj.toScreenLocation(marker.position) | |
startPoint.y = 0 | |
val startLatLng = proj.fromScreenLocation(startPoint) |
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
//routes | |
app.route('/api/teams/logo').all() | |
.post(teams.upload).all(teamsPolicy.isAllowed) | |
//server.controller | |
//sharp = require('sharp') :: http://sharp.dimens.io/ | |
exports.upload = function (req, res) { | |
var upload = multer(uploadConfig).single('photo'); | |
upload(req, res, function (uploadError) { | |
if (uploadError) { |
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
'use strict'; | |
angular.module('users').factory('PasswordGenerator', function () { | |
return { | |
generate: function (length, useUpper, useNumbers, userSymbols) { | |
var passwordLength = length || 12; | |
var addUpper = useUpper || true; | |
var addNumbers = useNumbers || true; | |
var addSymbols = userSymbols || true; |
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
let params = ["username":username,"token":token,"param1":param1,"param2":param2] | |
RestClient.request(self,method:.POST,URLString: RestApi.MY_URL,parameters:params, | |
onSuccess:{ data in | |
self.saveCache(data) | |
},onError:{ error in | |
},onFailure:{ | |
print("failed") |
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
//route | |
app.route('/mobile/v2/updateuser') | |
.post(users.checkAuthMiddleWare,mobile.updateuser); | |
//middleware | |
exports.checkAuthMiddleWare = function(req, res,next) { | |
console.log(req.body); | |
User.findOne({username:req.body.username,token:req.body.token},function(err,user){ | |
if(user){ | |
next(); |
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
/** | |
* Signup | |
*/ | |
exports.signup = function(req, res) { | |
console.log(req.body); | |
// For security measurement we remove the roles from the req.body object | |
delete req.body.roles; | |
// Init Variables | |
var user = new User(req.body); |
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
// | |
// RestClient.swift | |
// USJ-R Mobile | |
// | |
// Created by keithics on 10/7/15. | |
// Copyright © 2015 Web Ninja Technologies. All rights reserved. | |
// | |
import Foundation | |
import Alamofire |
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
package com.webninja.usjr.rest; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.webninja.usjr.libs.AppConstants; | |
import retrofit.RequestInterceptor; | |
import retrofit.RestAdapter; | |
import retrofit.client.OkClient; |
NewerOlder