An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
# 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#> |
license: apache-2.0 |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#!/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" |
# 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 |
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:
https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs
with the following as the POST body :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.
# 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, |
<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 () { |
<style> | |
/* IMPORTANT - must give map div height */ | |
#map-canvas { | |
height:400px; | |
} | |
/* IMPORTANT - fixes webkit infoWindow rendering */ | |
#map-canvas img { | |
max-width: none; | |
} |