Skip to content

Instantly share code, notes, and snippets.

Avatar

Pol Cámara PolCPP

View GitHub Profile
@PolCPP
PolCPP / dzi2edz.py
Created May 22, 2020
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
View dzi2edz.py
#!/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)
View gist:a17d937c094d9aeccb3c438085741faf
#!/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 Nov 12, 2018 — forked from valeryan/WindowsSetup.md
Local WSL Setup
View WindowsSetup.md

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 Jul 20, 2012
Strange behavior with mocha/chai/sequelize
View error.coffee
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
Get youtube views with jquery
View yt_get_views.js
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);
View test.py
#!/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")