Skip to content

Instantly share code, notes, and snippets.

View PolCPP's full-sized avatar

Pol Cámara PolCPP

View GitHub Profile
@PolCPP
PolCPP / dzi2edz.py
Created May 22, 2020 01:45
Quick&Dirty script to transform DZI to EDZ. Should only need py2 bash & command line zip. To run just: python dzi2edz.py duomo duomo/duomo.dzi where duomo is your dzi folder and duomo/duomo.dzi is the xml file
#!/usr/bin/env python
import sys
import json
import os
from zipfile import ZipFile
from xml.dom import minidom
dir_name = sys.argv[1]
fileHeader = 59 + len(dir_name)
#!/usr/bin/env python
import sys
import json
import os
from zipfile import ZipFile
from xml.dom import minidom
dir_name = sys.argv[1]
fileHeader = 59 + len(dir_name)
@PolCPP
PolCPP / WindowsSetup.md
Last active November 12, 2018 21:12 — forked from valeryan/WindowsSetup.md
Local WSL Setup

Windows Development Environment Setup

This document outlines the steps I take to setup my environment on windows using WSL. This requires being on the windows 10 Creative update or greater with an Ubuntu 16 installed as WSL.

Windows Setup Prerequisites

  1. Install WSL.
  2. Install Hyper and setup to use bash for windows (optional).
  3. Install Acrylic DNS Proxy.
  4. Download WSL Startup Scripts.
@PolCPP
PolCPP / error.coffee
Created July 20, 2012 20:07
Strange behavior with mocha/chai/sequelize
chai = require "chai"
crypto = require "crypto"
Sequelize = require "sequelize"
chai.should()
sequelize = new Sequelize 'talk', 'root','root', {
host: 'localhost'
logging: false
}
@PolCPP
PolCPP / yt_get_views.js
Created May 29, 2012 16:09
Get youtube views with jquery
function get_views(video_id) {
var URL = "https://gdata.youtube.com/feeds/api/videos/"+video_id+"?v=2&alt=json";
$.ajax({
type: "GET",
url: URL,
cache: false,
dataType:'jsonp',
success: function(data){
// Add your logic here. As an example it just logs it on the console
console.log(data.entry.yt$statistics.viewCount);
#!/usr/bin/env python
import os
import os.path
import sys
import subprocess
AB_TESTS_ENV = os.getenv("AB_TESTS_ENV")
AB_TESTS_PRIV = os.getenv("AB_TESTS_PRIV")