Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# encoding: utf-8
# frozen_string_literal: true
require 'pry'
require 'json'
require 'rest-client'
WIKIDATA_SPARQL_URL = 'https://query.wikidata.org/sparql'
@dsisnero
dsisnero / RDF_basic.rb
Created March 10, 2022 23:34 — forked from amejiarosario/RDF_basic.rb
RDF.rb basics
#=== Real life examples ===
graph = RDF::Graph.new
# read from file
graph = RDF::Graph.load("http://datagraph.org/jhacker/foaf.nt")
# -or- from the web
graph = RDF::Graph.load("http://dbpedia.org/resource/Elvis_Presley")
graph << RDF::RDFa::Reader.open("http://www.bestbuy.com/shop/ipad+xoom+-windows")
graph.each_predicate { |s| puts s.inspect }
@dsisnero
dsisnero / gem_make.out
Created January 11, 2022 16:16
numo-gsl gem_make.out
current directory: F:/windows/tools/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/numo-gsl-0.1.2/ext/numo/gsl/cdf
F:/windows/tools/ruby/Ruby31-x64/bin/ruby.exe -I F:/windows/tools/ruby/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220111-61612-q22xzx.rb extconf.rb
which: no gsl-config in (/f/windows/tools/ruby/Ruby31-x64/bin:/ucrt64/bin:/usr/bin:/_U1_:/f/windows/tools/ruby/Ruby31-x64/bin:/_U2_:/f/windows/scoop/apps/miniconda3/current/condabin:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin:/c/Python27:/c/Python27/Scripts:/c/app/client/dsisnero/product/12.2.0/client_1/bin:/c/oracle/product/12.2.0/client_1/bin:/c/Ruby26-x64/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/HID Global/ActivClient:/c/Program Files/HID Global/ActivClient:/c/Program Files/Tumbleweed/Desktop Validator:/c/Program Files/Tumbleweed/Desktop Validator/x86:/c/Program Files/dotnet:/c/Program Files/Microsoft SQL S
{
"version": "1.9.1.0",
"description": "Puppet Development Kit",
"homepage": "https://puppet.com/open-source/pdk",
"license": "Apache-2.0",
"architecture": {
"64bit": {
"url": "https://downloads.puppetlabs.com/windows/puppet6/pdk-1.9.1.0-x64.msi",
}
},
@dsisnero
dsisnero / ractor_worker_pool.rb
Created February 2, 2021 00:06 — forked from brandur/ractor_worker_pool.rb
Ractor worker pool
require 'kramdown'
require 'redcarpet'
require 'toml'
require 'yaml'
#
# pool
#
class WorkerPool
class Broadcaster
attr_reader :ractor
def initialize
@ractor = new_ractor
end
def new_ractor
Ractor.new { Ractor.recv rescue nil }
end
def broadcast(message)
next_ractor = new_ractor
require 'openssl'
require 'base64'
# calibrate numbers to get 1s or 10s in solo
N = 48
DATA_SIZE = 600_000
workers_N = 2
# prepare static data set
DATA_ARR = N.times.map do |n|
current directory: F:/windows/scoop/persist/ruby/gems/gems/nokogumbo-2.0.4/ext/nokogumbo
F:/windows/scoop/apps/ruby/2.7.2-1/bin/ruby.exe -I F:/windows/scoop/apps/ruby/2.7.2-1/lib/ruby/2.7.0 -r ./siteconf20201130-7788-1c890fl.rb extconf.rb
checking for libxml/tree.h in /home/flavorjones/code/oss/nokogiri/ports/x86_64-w64-mingw32/libxml2/2.9.10/include/libxml2... no
Downloading libxml2-2.9.10.tar.gz ( 0%)
Downloading libxml2-2.9.10.tar.gz ( 0%)
Downloading libxml2-2.9.10.tar.gz ( 0%)
Downloading libxml2-2.9.10.tar.gz ( 0%)
Downloading libxml2-2.9.10.tar.gz ( 0%)
Downloading libxml2-2.9.10.tar.gz ( 1%)
@dsisnero
dsisnero / spotify-now-playing.js
Created October 27, 2020 04:56 — forked from marco79cgn/spotify-now-playing.js
A Scriptable iOS widget that shows what‘s playing on Spotify
let spotifyCredentials
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
async function createWidget() {
let widget = new ListWidget()
let spotifyIcon = await getImage("spotify-icon.png")
widget.backgroundColor = new Color("1e2040")
@dsisnero
dsisnero / gem_make.out
Last active October 7, 2020 20:05
nokogumbo gem_make.out failure
current directory: F:/windows/scoop/persist/ruby/gems/gems/nokogumbo-2.0.2/ext/nokogumbo
F:/windows/scoop/apps/ruby/2.7.2-1/bin/ruby.exe -I F:/windows/scoop/apps/ruby/2.7.2-1/lib/ruby/2.7.0 -r ./siteconf20201007-24400-a64xgc.rb extconf.rb
checking for xmlNewDoc() in -lxml2... yes
checking for nokogiri.h in F:/windows/scoop/persist/ruby/gems/gems/nokogiri-1.10.10/ext/nokogiri... yes
creating Makefile
current directory: F:/windows/scoop/persist/ruby/gems/gems/nokogumbo-2.0.2/ext/nokogumbo
make "DESTDIR=" clean
current directory: F:/windows/scoop/persist/ruby/gems/gems/nokogumbo-2.0.2/ext/nokogumbo