Skip to content

Instantly share code, notes, and snippets.

@poguez
poguez / class-glassbox-initializer.php
Created April 16, 2021 10:10
How I initialize the routes for the plugin
class Glassbox_Initializer {
public function __construct() {
}
public function run() {
foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) {
if ( post_type_supports( $post_type->name, 'revisions' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'class-glassbox-controller.php';
@poguez
poguez / Amazon Photos or Amazon cloud drive.md
Created April 12, 2020 18:22
How to let Amazon Photos / Amazon Cloud Drive use an external drive

How to use an external drive with Amazon Photos or Amazon Cloud Drive

  1. Install the Amazon Photos Amazon Clour Drive application. When it asks you to sync from your cloud to your local, choose any folder in your hard drive.
  2. Then, turn off the the application
  3. Plug your external hard drive in.
  4. In your Finder, go to: /Users/USER_NAME/Library/Application Support/Amazon Cloud Drive
  5. Open file amzn1.account.#########-settings.json with your text editor, you will see somethings like this:
@poguez
poguez / clicka-botones-con-delay.js
Last active March 11, 2020 10:13
Click on two buttons repeatedly with a delay on the browser
function clickaRetry(){
document.querySelector("body > console-base-page > stencil-router > stencil-route-switch > stencil-route > datastore-request-status-page > div > enhanced-table > div > table > tbody > tr > td > div > confirmation-button div > button[data-role=\"retry-request\"]").click()
}
function clickaConfirm(){
document.querySelector("body > console-base-page > stencil-router > stencil-route-switch > stencil-route > datastore-request-status-page > div > enhanced-table > div > table > tbody > tr > td > div > confirmation-button div > button[data-role=\"confirm\"]").click()
}
function sleep(milliseconds) {
let timeStart = new Date().getTime();
@poguez
poguez / control-esc
Created February 17, 2020 09:50
Map Left Control to Escape and Control for HHKB Lite
{
"title": "Change Left Control to Esc and Control",
"rules": [
{
"description": "Post Esc if Control is tapped, Control if held.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_lock",
@poguez
poguez / slack_delete_old_files_script.py
Created March 26, 2018 06:44
Script for deleting files from slack with legacy API for users. Original source: https://gist.github.com/jackcarter/d86808449f0d95060a40
#################################################################################
#
# Script for deleting files from slack with legacy API for users.
#
# Original source: https://gist.github.com/jackcarter/d86808449f0d95060a40
#
#################################################################################
import requests
@poguez
poguez / Vagrantfile
Last active August 16, 2016 22:37
Vagrantfile, docker ubuntu 14.04
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.33.10"
It's almost time!! PARC is hosting the fourth CCNxCon technical conference - “Driving the next generation Internet: Content-Centric Networking Update & Conference” - at the PARC Pake Auditorium in Palo Alto, California on May 18 - 21, 2015.
The conference will highlight technical progress and share developer experiences from diverse industries and institutions. We’ll present our technical progress as well as have sessions, talks, demos and posters from industry and academia.
Sessions and talks will discuss progress on the pressing issues of security, privacy, APIs, network and distributed computing, and development tools, as well as the challenges of scale in a connected and mobile world. Day one of the conference is a deep dive for developers - a hands-on tutorial followed by an all-day hackathon / interop session. Days two and three will explore advances, experiences and proposals in the areas of protocols, security, software, and projects from the community. Day four will focus on architectural di
@poguez
poguez / Instrucciones.txt
Last active August 29, 2015 14:18
Entorno para el taller de Rails
Instala Vagrant en tu sistema:
https://www.vagrantup.com/downloads.html
Instala Virtual Box:
https://www.virtualbox.org/wiki/Downloads
Clona el repositorio de:
https://github.com/rails/rails-dev-box
$ git clone https://github.com/rails/rails-dev-box.git
@poguez
poguez / ckan_stats.py
Created September 16, 2014 00:23
Este es un script para sacar algunas métricas de ckan mediante API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import urllib2
def ckan_action(call_action):
url = "http://datamx.io/api/3/action/" + call_action
organization_list = json.load(urllib2.urlopen(url))
@poguez
poguez / gist:6fd31e34bd157103a96b
Created May 23, 2014 17:36
Problem installing CKAN release 2.2
---- Begin output of /home/ckan/pyenv/bin/pip install -e /home/ckan/ckan ----
STDOUT: Obtaining file:///home/ckan/ckan
Running setup.py (path:/home/ckan/ckan/setup.py) egg_info for package from file:///home/ckan/ckan
error: Namespace package problem: ckanext.stats is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
Complete output from command python setup.py egg_info:
running egg_info