Skip to content

Instantly share code, notes, and snippets.

View ncarboni's full-sized avatar

Nicola Carboni ncarboni

View GitHub Profile
@parente
parente / README.md
Last active October 1, 2023 23:42
Jupyter Tidbit: Display an image gallery

Summary

JupyterLab and Jupyter Notebook can display HTML-embedded images in notebook documents. You can use the IPython.display.HTML class to structure these images into a basic image gallery.

Example

Binder

The notebook below defines a gallery() function that accepts a list of image URLs, local image

@ettorerizza
ettorerizza / refinetranslator.py
Last active April 28, 2018 00:04
a mini Python3 script that transforms a list of operations performed in Open Refine into a text file easier to read. To use it, paste your Open Refine "undo/redo" history in a file named, for example, "operations.json", place this file in the same folder as the Python script, and run this command : python refinetranslator.py operations.json
#!/usr/bin/python3
import json
import sys
with open(sys.argv[1], "r") as infile:
data = json.load(infile)
outfile = open(sys.argv[1]+".txt", 'w')
count = 1
@lambdamusic
lambdamusic / keynote.scpt
Last active March 24, 2024 02:57
Apple Keynote: export presenter notes
-- HOWTO:
-- after saving it, open with Script Editor (default) and run it
-- PREREQUISITES:
-- make sure your Keynote presentation is open in the background
-- AFTER EXPORT:
-- if you can't open the file due to encoding errors, open with Sublime (or another a text editor) and then "File / Save with encoding / UTF8"
tell application "Keynote"
@flekschas
flekschas / Install-Cypher-Syntax-Highlight-ST3.md
Last active April 11, 2023 03:34
Add Syntax Highlighting for Cypher in Sublime Text 3

Credit goes to

  1. Jan Klaas Kollhof (and Fred Benenson)
  2. Chris Skardon

Installation

Since the original plugin has been developed for Sublime Text 2 we have to install it manually.

  1. Go to https://github.com/fredbenenson/sublime-cypher, download ZIP of the repo, extract the content and rename the folder to ‘Cypher’. You can download the original repo from https://github.com/kollhof/sublime-cypher but Fred Benenson introduced a handy fix for UTF-8 data, which hasn't integrated at the point of this writing.
@nicwolff
nicwolff / XML_breaker.py
Last active March 14, 2024 02:11
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0