Skip to content

Instantly share code, notes, and snippets.

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

Rogelio Heredia RogelioHIT

🏠
Working from home
  • Digono
  • Michoacan, México
View GitHub Profile
@RogelioHIT
RogelioHIT / NetworkManager.swift
Created May 31, 2022 17:13
Use client certificate on api request usng Alamofire
/*
This is a session for Alamofire where we add a certificate. This in case the client server has s self signed certficate.
You can use this constante inside your network manager and use it as
session.request(...)
.validate()
.response()
NOTE: The certificate has to be encoded in a der format not in pem, because apple only supports der as noted in this stackoverflow answer https://stackoverflow.com/a/51742988
@RogelioHIT
RogelioHIT / shuffle.js
Created May 11, 2020 18:01
Shuffle Divs
/*
Shuffle divs called .el in a random way
*/
function shuffleAnswers() {
let positions = [];
$(".el").each(function (i) {
positions.push(i);
});
positions.sort(function () {
return 0.5 - Math.random();