Skip to content

Instantly share code, notes, and snippets.

View fedemzcor's full-sized avatar
🏠
Working from home

Federico Márquez fedemzcor

🏠
Working from home
View GitHub Profile
@fedemzcor
fedemzcor / resources.tf
Created February 17, 2019 04:46 — forked from justinsoliz/resources.tf
Terraform S3 to Lambda notification
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_iam_role" "iam_for_terraform_lambda" {
name = "app_${var.app_env}_lambda"
assume_role_policy = <<EOF
{
package com.cleber.cleberclcfield.Util;
import android.util.Log;
import android.widget.Toast;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class VINValidator {
package com.example.joner.cleberclcrfidwrite.ReadRFIds;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.constraint.ConstraintLayout;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
<?php
require('_session.php');
if(!isset($_SESSION['code_cashier_device'] ) || $_SESSION['code_cashier_device'] ==''){
$data = $gm->query("SELECT D.name,D.model,D.version,D.platform,D.manufacturer,D.uuid AS device_uuid,CD.id AS id_cashier_device FROM cashier_device CD INNER JOIN device D ON D.id = CD.id_device WHERE CD.id_cashier = ".$_SESSION['id_cashier']." AND CD.active = 1 AND CD.disable = 0")->fetch();
if($data == false){
header("location: device?choose_device=1");
}else{
$_SESSION['device_name'] = $data['name']; #$data['manufacturer'].'-'.$data['model'].'-'.$data['platform'].'-'.$data['version'];
$_SESSION['device_uuid'] = $data['device_uuid'];
Comandos git
git branch //Check current branch
git checkout -b "CambiosFede" //Create branch
git push -u origin CambiosFede //Upload content to branch
git branch -d CambiosFede //Delete branch
public void getVinList(){
FC.mDatabase.child(FC.route).child("vin").orderByValue().addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
String[] spinnerArray;
public String hexToString(String txtInHex)
{
System.out.println(txtInHex);
byte [] txtInByte = new byte [txtInHex.length() / 2];
int j = 0;
for (int i = 0; i < txtInHex.length(); i += 2)
{
txtInByte[j++] = Byte.parseByte(txtInHex.substring(i, i + 2), 16);
}
@fedemzcor
fedemzcor / README.md
Created March 10, 2018 19:52 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@fedemzcor
fedemzcor / nginx-tuning.md
Created March 1, 2018 08:50 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
apt-get update
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install pkg-config libssl-dev libsslcommon2-dev
apt-get install php7.1-dev
pecl install mongodb
service php7.1-fpm restart
extension=mongodb.so