Skip to content

Instantly share code, notes, and snippets.

@adorsk-whoi
adorsk-whoi / sparql_multiple_facets_one_query.sparql
Created June 17, 2011 13:39
SPARQL: Multiple facets in one query
# This SPARQL query could be used to calculate facets for SPARQL result set.
# The base result is defined as a subquery.
# Facets are calculated for the result set, and are returned as rows consisting of a facet id, a label,
# and a count.
# This query works against Virtuoso SPARQL endpoints.
# You can try it the against dbpedia virtuoso sparql endpoint, but it will probably fail due to the DBPedia endpoint's
# performance limitations.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
@MoritzStefaner
MoritzStefaner / .block
Last active January 20, 2020 10:46
Force-based label placement
license: apache-2.0
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@jpstroop
jpstroop / sync_exist.sh
Created April 22, 2012 11:57
cron script for keeping eXist in sync with a filesystem
#!/bin/bash
#
# Load incremental changes since the last load. This script maintains a
# hidden file that keeps track of this information.
#
# UTILS
DATE="/bin/date"
CURL="/usr/bin/curl"
@harlantwood
harlantwood / push_to_github.rb
Created June 15, 2012 07:27
Commit and push via Github REST API, from ruby RestClient
# Committing changes to a repo via the Github API is not entirely trivial.
# The five-step process is outlined here:
# http://developer.github.com/v3/git/
#
# Matt Swanson wrote a blog post translating the above steps into actual API calls:
# http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html
#
# I was not able to find sample code for actually doing this in Ruby,
# either via the HTTP API or any of the gems that wrap the API.
# So in the hopes it will help others, here is a simple function to
@Potherca
Potherca / README.md
Last active November 27, 2023 17:44
Create a branch on Github without access to a local git repo using http://hurl.eu/

Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?

With the aid of [the Github API][1] and any online request app this is a piece of cake!

Just follow these steps:

  1. Open an online request app (like apirequest.io, hurl.it pipedream.com, reqbin.com, or webhook.site)
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl: https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs with the following as the POST body :
@emeeks
emeeks / README.md
Last active March 25, 2024 07:56 — forked from mbostock/.block
An online tool for interactive teaching of network visualization and representation principles.

The range sliders at the top change the values for the force-directed algorithm and the buttons load new graphs and apply various techniques. This will hopefully serve as a tool for teaching network analysis and visualization principles during my Gephi courses and general Networks in the Humanities presentations.

Notice this includes a pretty straightforward way to load CSV node and edge lists as exported from Gephi.

It also includes a pathfinding algorithm built for the standard data structure of force-directed networks in D3. This requires the addition of .id attributes for the nodes, however.

Now with Clustering Coefficients!

Also, it loads images for nodes but the images are not in the gist. The code also refers to different network types but the data files on Gist only refer to the transportation network.

@jpstroop
jpstroop / dzi_to_iiif.py
Last active October 15, 2020 14:09
DZI syntax to IIIF
# Take params from the DZI syntax and turn them into an IIIF request
#
# Copyright (C) 2009 CodePlex Foundation
# Copyright (C) 2010-2013 OpenSeadragon contributors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
@duncansmart
duncansmart / progressive-ace.htm
Created March 28, 2013 23:29
Integrating ACE Editor in a progressive way
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {
@johnschimmel
johnschimmel / index.html
Last active September 4, 2021 10:35
Demo of loading Google Maps, fetching Markers with AJAX, Geocoding new location and POSTing new location with AJAX. http://dwd-nodejs-remoteapis.herokuapp.com/
<style>
/* IMPORTANT - must give map div height */
#map-canvas {
height:400px;
}
/* IMPORTANT - fixes webkit infoWindow rendering */
#map-canvas img {
max-width: none;
}