Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"log"
"net/http"
"html/template"
"github.com/gorilla/sessions"
resolver = Prismic.link_resolver('master'){ |doc_link| "http:#localhost/#{doc_link.id}" }
serializer = Prismic.html_serializer do |element, html|
if element.is_a?(Prismic::Fragments::StructuredText::Block::Image)
# Don't wrap images in a <p> tag
%(<img src="#{element.url}" alt="#{element.alt}" width="#{element.width}" height="#{element.height}" />)
else
nil
end
end
doc = response.results[0]
@kinopyo
kinopyo / Gemfile
Last active December 28, 2018 00:23
Make Turbolinks work with DoubleClick for Publishers(alternative of Google Adsense)
gem 'turbolinks'
gem 'jquery-turbolinks'
@rmosolgo
rmosolgo / Gemfile
Last active March 27, 2023 08:38
GraphQL Ruby Subscriptions
source 'https://rubygems.org'
gem "graphql", github: "rmosolgo/graphql-ruby", branch: "subscriptions"
gem "sinatra"
gem "thin"
@hradec
hradec / tif-fp-image-display.py
Created November 12, 2024 00:14
tif-fp-image-display.py - display a floating point tif image without any color correction (mouse over shows pixel floating point value)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
from PIL import Image
import sys
import os
from PySide6.QtWidgets import QApplication
# Load the grayscale floating point TIFF image from command line
if len(sys.argv) != 2: