Skip to content

Instantly share code, notes, and snippets.

View mikel-egana-aranguren's full-sized avatar
🤘
Gora gu

Mikel Egaña Aranguren mikel-egana-aranguren

🤘
Gora gu
View GitHub Profile
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

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

The Result

@mhgrove
mhgrove / SesameExample.java
Last active September 26, 2017 17:49
Example of how to use Stardog's Sesame bindings
/*
* 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,

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@evren
evren / commands.log
Last active December 1, 2017 03:59
Example of using Stardog for data validation for the example described at http://www.w3.org/2012/12/rdf-val/SOTA.
# 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());
@evren
evren / CreateDBWithNamedGraphs.java
Last active October 2, 2019 08:29
Showing examples of efficiently loading multiple files into different named graphs using Stardog
// 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)
@serge1
serge1 / input.xml
Last active August 30, 2022 19:24
XSLT Transform by simple Java code
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]));
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
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
@amysimmons
amysimmons / js-tricky-bits.md
Last active July 2, 2024 20:06
Understanding closures, callbacks and promises in JavaScript

#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.