Skip to content

Instantly share code, notes, and snippets.

View tarpdalton's full-sized avatar
🍕

James Dalton tarpdalton

🍕
View GitHub Profile
@stain
stain / provenance-jsonld.json
Last active April 6, 2017 22:15
Provenance in PROV-O using JSON-LD - converted to Turtle
{
"@context": {
"xsd": "http://www.w3.org/2001/XMLSchema#",
"prov": "http://www.w3.org/ns/prov#",
"foaf": "http://xmlns.com/foaf/0.1/",
"agent": { "@type": "@id", "@id": "prov:agent" },
"entity": { "@type": "@id", "@id": "prov:entity" },
"activity": { "@type": "@id", "@id": "prov:activity" },
"hadPlan": { "@type": "@id", "@id": "prov:hadPlan" },
@opragel
opragel / tempfix_managedpref_parentalcontrolsd_cpu.sh
Last active January 27, 2018 16:56
tempfix_managedpref_parentalcontrolsd_cpu.sh
#!/bin/bash
# this is not following best practices
# removing explicit familyControlsEnabled keys to mitigate high parentalcontrolsd cpu usage
rm -rf /Library/Managed\ Preferences/com.apple.applicationaccess.new.plist
rm -rf /Library/Managed\ Preferences/*/com.apple.applicationaccess.new.plist
if pgrep 'parentalcontrolsd'; then
killall -STOP parentalcontrolsd
fi
@johnulist
johnulist / SPARQL-tests.md
Created April 27, 2016 15:59 — forked from ktk/SPARQL-tests.md
SPARQL performance tests

SPARQL CONSTRUCT comparison

I had some days left on a physical machine we used for an EU FP7 research project so I took the chance to compare 3 triplestores I or my colleagues worked with in the past months. I do not want to imply anything with this test, it's just me playing around and having fun with RDF. If you have any comments, add it here.

Hardware

The test platform comprises a dedicated server, not a virtual machine, with the following specification:

  • 2 x Intel Xeon E5 2620V2, 2 x (6 x 2.10 GHz) (appears as 24 cores in htop)
  • 128 GB buffered ECC RAM
@marcelmeyer
marcelmeyer / audit.api_request().sql
Last active March 14, 2018 17:07
Allows for some logging and debugging of PostgREST requests. All the x-* headers set by the reverse proxy.
create or replace function audit.api_request() returns void
language plpgsql
as $$
declare
_request_id text := coalesce(current_setting('request.header.x-request-id', true),'');
_role text := coalesce(current_setting('request.jwt.claim.role', true),'');
_user_id text := coalesce(current_setting('request.jwt.claim.id', true),'');
_resource text := coalesce(current_setting('request.header.x-path', true),'');
_verb text := coalesce(current_setting('request.header.x-verb', true),'');
@mistahenry
mistahenry / file_io.scala
Created April 19, 2014 21:56
Read file into List of lines in Scala
import scala.io.Source
val listOfLines = Source.fromFile("filename.txt").getLines.toList
@tmelz
tmelz / pre-commit.sh
Last active April 12, 2023 15:09
auto format java files with google-java-format
#!/bin/bash
# Auto format changed java files using google-java-format.
# To install, copy this file into $repo/.git/hooks and remove the .sh extension.
# Download the google-java-format JAR from
# https://github.com/google/google-java-format
# A more mature implementation of this would be a plugin for Yelp's pre-commit library:
# http://pre-commit.com/
echo "Running auto-formatter for any changed Java files"
echo "(formatting changes will be automatically added to your commit)"
@DocX
DocX / README.md
Last active September 5, 2023 12:58
Connect to bash inside running ECS container by cluster and service name
@mbostock
mbostock / .block
Last active November 7, 2023 07:54
Collapsible Tree
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-collapsible-tree
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@Badestrand
Badestrand / react-mini.html
Last active January 28, 2024 12:01
Simple React in browser
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style rel="stylesheet" type="text/less">
* {
margin: 0;
padding: 0;