Skip to content

Instantly share code, notes, and snippets.

View stevenroose's full-sized avatar
👀
looking for a decentralized GitHub alternative

Steven Roose stevenroose

👀
looking for a decentralized GitHub alternative
View GitHub Profile
Steven-Rooses-MacBook-Pro:capsel4 steven$ python3 ~/Downloads/problog2/src/problog.py /Volumes/Data/Google\ Drive/school/irw/1ma/mettim/capsel4/part1.pl
Calling external process failed:
Command '/Users/steven/Downloads/problog2/assist/darwin/dsharp -Fnnf /var/folders/91/_k0t34l161qf90jgdsd995q40000gn/T/tmpu1jtlxz1/compile_cnf.nnf -Fgraph /var/folders/91/_k0t34l161qf90jgdsd995q40000gn/T/tmpu1jtlxz1/compile_cnf.nnf.graph -smoothNNF -disableAllLits /var/folders/91/_k0t34l161qf90jgdsd995q40000gn/T/tmpu1jtlxz1/compile_cnf' returned -11
Verifying myself: My Bitcoin username is +stevenroose. https://onename.io/stevenroose
@stevenroose
stevenroose / gist:010f3b8671141f31ca79
Last active August 29, 2015 14:10
Performance comparison between two big integer implementations in Dart
/**
* Results for the Dart VM (v1.7.2)
* Duration for bignum's BigInteger: 59s
* Duration for rational's BigInt: 197s
*
* Results for dart2js in Chrome (v39.0.2171.62)
* Duration for bignum's BigInteger: 77s
* Duration for rational's BigInt: 474s
*/
@stevenroose
stevenroose / enable_ssl.dart
Last active June 4, 2021 06:25
Setup CA-enabled SSL for Dart
void enableSSL() {
// the password used for the certutil db
var sslPassword = "";
// the certificate subject
// retrieved from certutil with command
// > certutil -d sql:. -L -n my_domain
// and look for the "Subject: " line under certificate data
var certificateName = "CN=mydomain.com,OU=...";
@stevenroose
stevenroose / gist.md
Last active August 29, 2015 14:15
Using deferred loading to create environment-independent libraries in Dart

Using deferred loading to create environment-independent libraries in Dart

The problem

Upon creating my first Dart library, I bumped into the issue of the environment-dependent libraries dart:io and dart:html, and most importantly the fact that some very similar functionality is present in both of them.

It bothered my ever-since that many libraries had to split up into two counterparts and so did some of the classes within. Let's say one of your classes uses WebSockets. The WebSocket is defined differently in dart:io and dart:html. So what you have to do create an abstract class for the general case and then create two subclasses in their own libraries that fill the gap of the WebSocket interface.

It would look like this:

library environment;
import "dart:async";
import "dart:io" deferred as io;
import "dart:html" deferred as html;
Future inEnvironment({Future onIo(), Future onHtml()}) {
Completer c = new Completer();
io.loadLibrary().then((_) {
@stevenroose
stevenroose / install-openbazaar-fedora.txt
Last active April 2, 2018 15:23
Building OpenBazaar on Fedora 22 (64-bit)
- Install NPM (NodeJS package manager)
$ sudo npm install -g grunt-cli
$ sudo npm install grunt-electron-debian-installer --save-dev
$ git clone https://github.com/OpenBazaar/OpenBazaar-Installer
$ cd OpenBazaar-Installer/
$ ./make_installer.sh linux64

Keybase proof

I hereby claim:

  • I am stevenroose on github.
  • I am stevenroose (https://keybase.io/stevenroose) on keybase.
  • I have a public key ASACB4HJj8SI677iU3V4yFWthFL3GkOIcHyQTq4fich4LQo

To claim this, I am signing this object:

@stevenroose
stevenroose / a-httpupload-prosody.md
Last active September 26, 2016 06:17
Installing HttpUploadComponent for Prosody on Debian with nginx

Instructions for Prosody on Debian

1. Install

  • Install Python and PIP
sudo apt-get install python3.4 python3-pip
This file has been truncated, but you can view the full file.
86043 silly lifecycle glob@7.1.1~preinstall: no script for preinstall, continuing
86044 silly lifecycle archiver-utils@1.3.0~preinstall: no script for preinstall, continuing
86045 silly lifecycle rimraf@2.5.4~preinstall: no script for preinstall, continuing
86046 silly lifecycle fs-extra@0.30.0~preinstall: no script for preinstall, continuing
86047 silly lifecycle fs-extra@0.30.0~preinstall: no script for preinstall, continuing
86048 silly lifecycle fs-extra@0.26.7~preinstall: no script for preinstall, continuing
86049 silly lifecycle fs-extra-tf@0.30.3~preinstall: no script for preinstall, continuing
86050 silly lifecycle fs-extra-p@1.2.0~preinstall: no script for preinstall, continuing
86051 silly lifecycle utile@0.3.0~preinstall: no script for preinstall, continuing
86052 silly lifecycle prompt@1.0.0~preinstall: no script for preinstall, continuing