Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
/* | |
* Copyright (c) 2010-2015 Clark & Parsia, LLC. <http://www.clarkparsia.com> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# Stardog commands and the output for RDF validation example | |
# First create the Stardog database and load data | |
$ ./stardog-admin db create -n sota sota-data.ttl | |
Bulk loading data to new database. | |
Loading data completed...Loaded 25 triples in 00:00:00 @ 0.4K triples/sec. | |
Successfully created database 'sota'. | |
# Then add the constraints to the database |
// this is where we'll store our constraints | |
Sail aConstraints = new MemoryStore(); | |
aConstraints.initialize(); | |
// more specifically, we'll store them in a particular named graph | |
URI aConstraintGraph = Values.iri("urn:icv"); | |
// and here is our database. note this can be *any* type of Repository | |
Repository aRepo = new SailRepository(new MemoryStore()); |
// Copyright (c) 2013 -- Clark & Parsia, LLC. <http://www.clarkparsia.com> | |
// For more information about licensing and copyright of this software, please contact inquiries@clarkparsia.com. | |
package com.complexible.stardog; | |
import java.io.File; | |
import java.io.PrintStream; | |
import java.nio.file.Path; | |
import java.util.Map; | |
import java.util.concurrent.TimeUnit; |
// Accepts the SPARQL Update queries | |
stardog.update("DELETE { ?a ?b \"hello world2\" } INSERT { ?a ?b \"aloha world2\" } WHERE { ?a ?b \"hello world2\" }") | |
def list = [] | |
stardog.query("SELECT ?x ?y ?z WHERE { ?x ?y \"aloha world2\" } LIMIT 2", { list << it } ) | |
assertTrue(list.size == 1) |
import javax.xml.transform.*; | |
import javax.xml.XMLConstants; | |
import javax.xml.transform.stream.StreamResult; | |
import javax.xml.transform.stream.StreamSource; | |
import java.io.File; | |
public class XsltTransform { | |
public static void main(String[] args) throws TransformerException { | |
Source xslt = new StreamSource(new File(args[0])); | |
Source xml = new StreamSource(new File(args[1])); |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
#Understanding closures, callbacks and promises
For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.
10 months into my full-time dev career, and I would struggle to explain these words to a peer.
So I decided it was time to face my fears, and try to get my head around each concept.
Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.