This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
API_URL="https://api.instagram.com/v1/tags/foodporn/media/recent" | |
TOKEN="PUT YOUR TOKEN HERE" | |
request_next_url() { | |
URL="$1" | |
#http2 connections seem to be immune to connection issues. | |
#echo $(curl --http2 --verbose "$URL" 2>> trace-http2.log | jq .pagination.next_url | tr -d '"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"created_at": "Mon Sep 19 19:36:50 +0000 2016", | |
"id": 777954621826342912, | |
"id_str": "777954621826342912", | |
"text": "@SobatRizalRamli @rajomalano @republikaonline @antaranews @BeritasatuTV @PKSejahtera @Gerindra @PDemokrat… https://t.co/whQg3y7tGe", | |
"source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>", | |
"truncated": true, | |
"in_reply_to_status_id": 777953136774225921, | |
"in_reply_to_status_id_str": "777953136774225921", | |
"in_reply_to_user_id": 767731724201529347, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function crawl_for_urls() { | |
if [ $# != 1 ]; then | |
echo "usage: crawl_for_urls URL" >2 | |
exit 1 | |
fi | |
wget --spider --force-html -r "$1" 2>&1 | \ | |
grep '^--' | \ | |
awk '{ print \$3 }' | \ | |
grep -v '\.\(css\|js\|png\|gif\|jpg\)$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration template for OpenBEL API | |
# BEL configuration. | |
bel: | |
# The BEL version supported by this OpenBEL API instance. | |
# Allowed values: | |
# 1.0 | |
# (BEL version 1.0 specification) | |
# 2.0 | |
# (BEL version 2.0 specification) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
require 'set' | |
numbers = (0..10_000_000).to_a | |
hash = Hash[numbers.map { |n| [n, true] }] | |
set = Set.new(numbers) | |
Benchmark.ips do |x| | |
x.warmup = 5 | |
x.time = 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/unit/language/version1/syntax/v1_syntax_spec.rb b/spec/unit/language/version1/syntax/v1_syntax_spec.rb | |
index 513d716..ad590c1 100644 | |
--- a/spec/unit/language/version1/syntax/v1_syntax_spec.rb | |
+++ b/spec/unit/language/version1/syntax/v1_syntax_spec.rb | |
@@ -33,4 +33,18 @@ describe 'parsing' do | |
end | |
end | |
end | |
+ | |
+ context 'partial' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/bel_parser/parsers/ast/node.rb b/lib/bel_parser/parsers/ast/node.rb | |
index 18dfb81..fabd143 100644 | |
--- a/lib/bel_parser/parsers/ast/node.rb | |
+++ b/lib/bel_parser/parsers/ast/node.rb | |
@@ -823,83 +823,83 @@ module BELParser | |
# | |
# @see https://en.wikipedia.org/wiki/S-expression S-expression | |
module Sexp | |
- def nested_statement(*children) | |
+ def nested_statement(*children, **properties) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
@prefix skos: <http://www.w3.org/2004/02/skos/core#> . | |
@prefix belv: <http://www.openbel.org/vocabulary/> . | |
belv:NamespaceConceptScheme rdfs:subClassOf skos:ConceptScheme . | |
<http://identifiers.org/ncbigene> rdf:type skos:ConceptScheme . | |
<http://identifiers.org/hgnc> rdf:type skos:ConceptScheme . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"evidence": { | |
"bel_statement": "a(CHEBI:\"phorbol 13-acetate 12-myristate\") -> kin(p(HGNC:MAPK1))", | |
"citation": { | |
"type": "PubMed", | |
"name": "J Biol Chem. 1997 Jul 4;272(27):16917-23.", | |
"id": null, | |
"date": null, | |
"authors": null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# read program arguments | |
import sys | |
program_arguments = sys.argv[1:] | |
if len(program_arguments) != 3: | |
sys.stderr.write( | |
"usage: replace_line.py [FILE] [MATCH] [REPLACE]\n" | |
) | |
file_name, match_line, replace_line = program_arguments |
NewerOlder