Skip to content

Instantly share code, notes, and snippets.

View berezovskyi's full-sized avatar

Andrew Berezovskyi berezovskyi

View GitHub Profile
@justin2004
justin2004 / 0_README.md
Last active January 2, 2023 15:55
RDFS Reasoner Challenge (Tbox with 3M triples)

RDFS Reasoner Challenge (~3M Tbox triples, 1 Abox triple)

Goal

The goal is simple: infer class membership (using rdfs:subClassOf and rdf:type predicates). Don't do it with a property path or something. You must let the reasoner do it.

Attempts

I've tried to do this with a few reasoners. All unsuccessful.

  • Apache Jena wasn't able to do it with 12GB of RAM.
  • Stardog wasn't able to do it with 12GB of RAM.
@artizirk
artizirk / git-instaweb.sh
Created January 22, 2019 18:57
git-instaweb with python simplehttpserver support
#!/bin/sh
#
# Copyright (c) 2006 Eric Wong
#
PERL='/usr/bin/perl'
OPTIONS_KEEPDASHDASH=
OPTIONS_STUCKLONG=
OPTIONS_SPEC="\
git instaweb [options] (--start | --stop | --restart)
@spyesx
spyesx / youtube_watch_later.js
Last active March 27, 2024 18:58
Get URLs of your youtube watch later playlist
// Execute this in the console of on your own playlist
var videos = document.querySelectorAll('.yt-simple-endpoint.style-scope.ytd-playlist-video-renderer');
var r = [];
var json = [];
r.forEach.call(videos, function(video) {
var url = 'https://www.youtube.com' + video.getAttribute('href');
url = url.split('&list=WL&index=');
url = url[0];
@shapiro125
shapiro125 / import.scpt
Last active March 7, 2021 12:57 — forked from bzerangue/import.scpt
Applescript: Import Apple Notes to Evernote
tell application "Notes"
set theMessages to every note
repeat with thisMessage in theMessages
# added identification of folder to create notebooks based on existing folder hierarchy
set myFolder to the container of thisMessage
@depp
depp / problem.cpp
Last active December 21, 2021 19:04
A Faster Solution
// Faster solution for:
// http://www.boyter.org/2017/03/golang-solution-faster-equivalent-java-solution/
// With threading.
// g++ -std=c++11 -Wall -Wextra -O3 -pthread
// On my computer (i5-6600K 3.50 GHz 4 cores), takes about ~160 ms after the CPU
// has warmed up, or ~80 ms if the CPU is cold (due to Turbo Boost).
// How it works: Start by generating a list of losing states -- states where the
// game can end in one turn. Generate a new list of states by running the game
@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@bzerangue
bzerangue / import.scpt
Created January 12, 2016 20:12
Applescript: Import Apple Notes to Evernote
tell application "Notes"
set theMessages to every note
repeat with thisMessage in theMessages
set myTitle to the name of thisMessage
set myText to the body of thisMessage
@vlad-ivanov-name
vlad-ivanov-name / Kicad circular layout
Last active February 27, 2021 20:43
Kicad circular layout
"""
Usage: open pcbnew and select Tools — Scripting console
Enter the following and press enter:
execfile("path/to/script.py")
Script settings can be adjusted below
"""
import pcbnew
import sys
@allanmac
allanmac / tk1_gpu_max_clock.sh
Last active August 14, 2017 13:25
Some login tweaks for L4T 19.3 to disable USB autosuspend and lock the GPU to max MHz. I have lines 3-11 of tk1_tweaks.sh appended to my .profile.
#!/bin/bash
#
# Lock GPU and MEM clocks to max MHz
#
# - benchmarking shows there is no need to override the MEM clock
#
echo
echo Locking GPU clock to max MHz for debugging porpoises...
# set to max
@mikemaccana
mikemaccana / gist:10847077
Created April 16, 2014 10:13
Tptacek's Review of "Practical Cryptography With Go"

Wow. I've now read the whole book and much of the supporting code. I'm not a fan, and recommend against relying on it. Here's a laundry list of concerns:

  • The teaching method the book uses is badly flawed. The book's strategy is to start simple and build to complexity, which makes sense if you're teaching algebra but not if you're teaching heart surgery. The result is that each chapter culminates with the implementation of a system that is grievously insecure. Little warning is given of this, apart from allusions to future chapters improving the system. For instance, Chapter 2 closes with a chat system that uses AES-CBC without an authenticator.

  • The book is full of idiosyncratic recommendations. For instance, AES-CBC requires a padding scheme. There is a standard padding scheme. The book purports to present it, but instead of PKCS7, it presents 80h+00h..00h.

  • At one point about 1/3rd of the way through the book, it suggests using a SHA256 hash of the plaintext as an authenticator for a message. Thi