Skip to content

Instantly share code, notes, and snippets.

View abargnesi's full-sized avatar

Tony Bargnesi abargnesi

View GitHub Profile
@abargnesi
abargnesi / free_invalid_pointer_test.rb
Created April 25, 2014 13:16
invalid pointer tests in redlander
#!/usr/bin/env ruby
require 'redlander'
include Redlander
class Node
def self.finalize_node(rdf_node_ptr)
proc {
# XXX Uncommenting the following line seems to invalidate the "rdf_node_ptr". Then the librdf_free_node call always succeeds without error.
#Redland.librdf_node_get_type(rdf_node_ptr)
Redland.librdf_free_node(rdf_node_ptr)
@abargnesi
abargnesi / 0_Gemfile_only_git
Created July 18, 2014 03:08
'bundler package --all' fails to find git-sourced gem if Bundler.setup is called twice. Fails in '3_terminal_multiple.md' as well as with the '4_example.rb'.
source 'https://rubygems.org'
gem 'bel', :git => 'https://github.com/OpenBEL/bel.rb.git'
@abargnesi
abargnesi / 0_directories
Created July 18, 2014 15:15
Using local directories for gem dependency paths.
.
├── directories
├── Gemfile
├── Gemfile.dev
├── Gemfile.dev.lock
├── Gemfile.lock
├── libraries
│   └── gemx
│   ├── gemx.gemspec
│   └── lib
@abargnesi
abargnesi / redland.rb
Created July 30, 2014 19:55
Streaming statements, with configurable return values, using the ruby redland-bindings
require_relative '../api.rb'
require 'rdf/redland'
require_relative './triple_iterator.rb'
module OpenBEL
class Storage
include OpenBEL::StorageAPI
DEFAULTS = {
storage: 'sqlite',
@abargnesi
abargnesi / gem-fetch-dependencies
Last active August 29, 2015 14:04 — forked from Milly/gem-fetch-dependencies
Works with rubygems on ruby 2.1.2
#!/usr/bin/env ruby
require 'rubygems'
require 'rubygems/commands/fetch_command'
class Gem::Commands::FetchCommand
def add_version_option_with_fetch_depends
add_version_option_without_fetch_depends
add_option('-y', '--[no-]dependencies', "Fetch dependent gems") do |value, options|
options[:dependencies] = value
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f4a7c7c7e10, pid=19173, tid=139957912000256
#
# JRE version: Java(TM) SE Runtime Environment (7.0_65-b17) (build 1.7.0_65-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libzmq.so.3+0x26e10] zmq::socket_base_t::process_term(int)+0x80
#
@abargnesi
abargnesi / gist:72be7fcb7009adb82e14
Created August 6, 2014 18:26
Fail to migrate using sqlite database...SQL compliant ALTER syntax?
[tony@starship openbel-webtools (master * u=)]$ rm db/development.sqlite3
[tony@starship openbel-webtools (master * u=)]$ rm db/test.sqlite3
[tony@starship openbel-webtools (master * u=)]$ rake db:setup
-- create_table("belfiles", {:force=>true})
-> 0.0494s
-- initialize_schema_migrations_table()
-> 0.1396s
You have 3 pending migrations:
20140806032021 CreateGraphs
20140806032038 CreateNodes
@abargnesi
abargnesi / gist:cb3c603dda4d7a50cd96
Created August 7, 2014 17:22
rails controller exceptions
Started GET "/belfiles/new" for 127.0.0.1 at 2014-08-07 13:20:58 -0400
Processing by BelfilesController#new as HTML
Rendered belfiles/new.html.erb within layouts/application (17.1ms)
Completed 500 Internal Server Error in 78ms
ActionView::Template::Error (couldn't find file 'cytoscape.js/dist/cytoscape.js'
(in /home/tony/work/repos/openbel-webtools/app/assets/javascripts/application.js:16)):
3: <head>
4: <title>OpenbelWebtools</title>
5: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
@abargnesi
abargnesi / gist:51a534ed7fb13703b423
Created August 12, 2014 12:54
BrightstarDB build failure on Mono 3.8.1 (from source)
XBuild Engine Version 12.0
Mono, Version 3.8.1.0
Copyright (C) 2005-2013 Various Mono authors
Build started 8/12/2014 8:52:02 AM.
__________________________________________________
Project "/home/tony/work/repos/BrightstarDB/src/core/BrightstarDB/BrightstarDB.csproj" (default target(s)):
Target RestorePackages:
Executing: mono --runtime=v4.0.30319 ../.nuget/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "../"
Restoring NuGet packages...
@abargnesi
abargnesi / gist:4ba68271dd559d797e19
Created August 12, 2014 18:44
KAM Visualization style as cytoscape.js style json.
[ {
"format_version" : "1.0",
"generated_by" : "cytoscape-3.1.1",
"target_cytoscapejs_version" : "~2.1",
"title" : "Universe",
"style" : [ {
"selector" : "node",
"css" : {
"background-color" : "rgb(0,0,0)",
"height" : 40.0,