Skip to content

Instantly share code, notes, and snippets.

View edgarRd's full-sized avatar
💻

Edgar Rodriguez edgarRd

💻
View GitHub Profile
@edgarRd
edgarRd / TypeConvert.cs
Created December 20, 2010 22:17
Type conversions and casts.
namespace Tools
{
public class TypeConvert
{
public static ObjectTarget[] convertArrayTo(ObjectSource[] objElems)
{
ObjectTarget[] objsTarget = Array.ConvertAll<ObjectSource, ObjectTarget>(objElems,
delegate(ObjectSource obj)
{
return (ObjectTarget) obj;
@edgarRd
edgarRd / .gitconfig
Last active September 28, 2015 07:08
Git Aliases
[user]
name = Edgar Rodriguez
email = edgar@clarkparsia.com
[core]
editor = vim
[color]
ui = true
[github]
user = edgarRd
[ghi]
@edgarRd
edgarRd / forEach.js
Last active October 9, 2015 01:28 — forked from cloudxero/gist:2369313
IE8/IE7 Compatibility
// Production steps of ECMA-262, Edition 5, 15.4.4.18
// Reference: http://es5.github.com/#x15.4.4.18
if ( !Array.prototype.forEach ) {
Array.prototype.forEach = function( callback, thisArg ) {
var T, k;
if ( this === null ) {
throw new TypeError( " this is null or not defined" );
@edgarRd
edgarRd / gist:3630461
Created September 5, 2012 04:30
TextMate 2 .tm_properties

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

@edgarRd
edgarRd / readme.md
Created September 13, 2012 20:13 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@edgarRd
edgarRd / gist:4541396
Last active December 11, 2015 03:58
Markdown Cheat Sheet

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@edgarRd
edgarRd / testAddInTransaction.js
Last active December 15, 2015 12:59
Stardog.js Transaction Add data
var stardog = require('../js/stardog');
var qs = require('querystring');
// -----------------------------------
// Tests for transactions.
// -----------------------------------
describe ("Getting and using transactions.", function() {
var conn;
var txId;
@edgarRd
edgarRd / transaction_add_prefixes.js
Last active August 29, 2015 14:06
Adding triples in transaction with custom prefixes
it("Should be able to get a transaction, add a triple with a defined prefix, commit that and query.", function(done) {
var aTriple = "@prefix foo: <http://localhost/publications/articles/Journal1/1940/> .\n"+
"@prefix dc: <http://purl.org/dc/elements/1.1/> .\n"+
"foo:Article2 "+
"dc:subject "+
"\"A very interesting subject\"^^<http://www.w3.org/2001/XMLSchema#string> .";
conn.onlineDB( { database: "nodeDB", strategy: "NO_WAIT" }, function () {
@edgarRd
edgarRd / keybase.md
Created September 25, 2014 00:24
keybase.md

Keybase proof

I hereby claim:

  • I am edgarrd on github.
  • I am edgarrd (https://keybase.io/edgarrd) on keybase.
  • I have a public key whose fingerprint is 449B B170 D640 C7F1 6802 9428 19EA 6E5A C232 D40C

To claim this, I am signing this object:

@edgarRd
edgarRd / vehicles.trig
Last active September 11, 2015 19:37
RDF dataset in TriG for Vehicles - Reasoning & Stardog Rules example
# Sample obtained from:
# http://www.dotnetrdf.org/content.asp?pageID=Inference%20and%20Reasoning
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix vh: <http://example.org/vehicles/> .
@prefix : <http://myvehicledata.com/> .
@prefix rule: <tag:stardog:api:rule:> .