Skip to content

Instantly share code, notes, and snippets.

View ferares's full-sized avatar

Fermín Ares ferares

View GitHub Profile
@lucianolacurcia
lucianolacurcia / bcuapi.md
Last active May 16, 2025 17:52
BCU API - Uruguay - Obtener cotizaciones - minidocs

Cotizaciones BCU:

Para obtener las cotizaciones del Banco Central de Uruguay a través de su API se debe llamar al enpoint:

https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/awsbcucotizaciones?wsdl

Utilizando el método http POST, añadiendo en el body de la solicitud, un xml con el sigiuente formato:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cot="Cotiza">
   <soapenv:Header />
@neg4n
neg4n / paste-this-into-console.js
Created April 26, 2021 20:39
Unregister all service workers in Safari
// Simple & convinient way to remove all service workers registered for specific web page
// Useful when working with PWA
// Paste code below to the console, it should return Promise
const getRidOfAllServiceWorkers = async () => {
const registry = await navigator.serviceWorker.getRegistrations()
for (const entry of registry) {
entry.unregister()
}
}
@MogulChris
MogulChris / functions.php
Last active July 31, 2022 23:37
Hooking into the native WooCommerce product import
<?php
//Since 3.x WooCommerce has had an excellent native product import/export.
//You can do a huge amount just by tweaking your CSV to load meta values into the correct meta fields for your destination site.
//It'll even import images from the source site by URL if possible, and upload them to the destination site.
//If you need to do something a little fancier for every product you import, check out the woocommerce_product_import_* hooks here https://woocommerce.github.io/code-reference/hooks/hooks.html
//You can modify the CSV data before it's used, and modify the resulting WC_Product during and after creation
//eg do something to every product after it's created
@hayahyts
hayahyts / ViewController.swift
Last active June 21, 2025 01:38
How to prevent WKWebView to repeatedly ask for permission to access location?
import UIKit
import WebKit
import CoreLocation
class ViewController: UIViewController , CLLocationManagerDelegate, WKScriptMessageHandler{
var webView: WKWebView?
var manager: CLLocationManager!
override func viewDidLoad() {
super.viewDidLoad()
@Jamp
Jamp / cotizaciones.php
Created February 13, 2019 00:41 — forked from jtechera/cotizaciones.php
Cotizacion de monedas y U.I. desde el BCU (Uruguay)
<?php
function getCotizaciones($monedas = true)
{
$url = 'https://www.bcu.gub.uy/_layouts/BCU.Cotizaciones/handler/CotizacionesHandler.ashx?op=getcotizaciones';
$data = "";
$last_date_found = false;
$diff = 1;
$cotizaciones = array();
$codigosAceptados = array("USD", "EURO", "CHF", "GBP", "ARS", "BRL", "JPY", "U.I.");
@MaskeZen
MaskeZen / cotizacionBCU.php
Created August 16, 2018 14:23
Cotización del BCU WS
<?php
getCotizacionesWS();
function getCotizacionesWS(){
$context = [
"ssl" => [
"verify_peer" => FALSE,
"verify_peer_name" => FALSE,
'crypto_method' => STREAM_CRYPTO_METHOD_TLS_CLIENT
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@jakubfiala
jakubfiala / custom_console.js
Created February 1, 2016 14:05
this small script intercepts the standard console methods and provides a way of accessing their messages, as well as stack traces, which is really cool. it formats the stack traces for popular browsers
//==========================================================
// CUSTOM JAVASCRIPT CONSOLE
// built by jakub fiala
//
// this small script intercepts the standard console methods
// and provides a way of accessing their messages,
// as well as stack traces, which is really cool.
// it formats the stack traces for popular browsers
//
// contributions welcome!
@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone [email protected]:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync [email protected]:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active March 12, 2025 01:22
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");