Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Come on 2021!

Javier Hernán Caballero García caballerojavier13

🚀
Come on 2021!
View GitHub Profile
View get_pais.js
//http://utils.mucattu.com/iso_3166-1.html
$.getJSON('http://www.freegeoip.net/json/?callback=?', function(data) {
var userip = data.ip;
var country_code = null;
$.getJSON('http://ipinfo.io/' + userip, function(data){
country_code = data.country;
alert(country_code);
});
});
View PregressBar.sh
#!/bin/bash
# Author : Teddy Skarin
# 1. Create ProgressBar function
# 1.1 Input is currentState($1) and totalState($2)
function ProgressBar {
# Process data
let _progress=(${1}*100/${2}*100)/100
let _done=(${_progress}*4)/10
let _left=40-$_done
View gist:a71a36c7ac8931ccdb9cb220fb6a3b62
var page_object = client.page.page_object();
page_object
.getAttribute('@panelBodyCollapsible', "class", function(result) {
this.assert.equal(result.value, "active");
});
View nightwatch_dinamic_selector.js
// ===============================================================================================//
//page
module.exports = {
url: function() {
return 'https://' + this.api.globals.host + '/#/products/';
},
elements: {
product: ".product[data-product-name='%s']"
},
@caballerojavier13
caballerojavier13 / SeleniumGridTutorial.md
Created Apr 4, 2018 — forked from dzitkowskik/SeleniumGridTutorial.md
A simple tutorial of using selenium grid in python unittests
View SeleniumGridTutorial.md

Prepare files & libraries

  1. Download selenium standalone server from: http://goo.gl/rQhaxb, Create local folder at ~/selenium and copy or move jar to that path:
$ mkdir ~/selenium
$ cd ~/selenium
$ wget http://goo.gl/rQhaxb
$ mv selenium-server-standalone-2.49.1.jar ~/selenium/
View upload_picture_node.js
/**
* This gist was inspired from https://gist.github.com/homam/8646090 which I wanted to work when uploading an image from
* a base64 string.
* This code is used in my startup, Zired.
* Web: http://zired.io
*/
// You can either "yarn add aws-sdk" or "npm i aws-sdk"
const AWS = require('aws-sdk')
View Appium.java
if (devicePlatform.contains("fullReset")) { // uninstall and install client
System.out.println(" Driver DO FULL-RESET");
capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
} else if (devicePlatform.contains("fastReset")) { // clears cache and settings without reinstall
System.out.println(" Driver DO FAST-RESET");
capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
} else { // just start client
System.out.println(" Driver DO NORMAL start");
View capabilitySets.json
{
"platformName": "Android",
"deviceName": "Moto G",
"bundleId": "com.caballero.javier",
"app": "app.apk",
"appActivity": "com.caballero.javier.launch.LaunchActivity",
"fullReset": true
}
View install_portainer.sh
docker volume create portainer_data
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --name portainer --restart always -v portainer_data:/data portainer/portainer
@caballerojavier13
caballerojavier13 / cors-nginx.conf
Created Jan 8, 2019 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
View cors-nginx.conf
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
You can’t perform that action at this time.