Skip to content

Instantly share code, notes, and snippets.


Jakub T. Jankiewicz jcubic

View GitHub Profile
View SVGMatrix.js
3x3 2D Matrix
[a c e]
[b d f]
[0 0 1]
var DOMException = require('domexception');
jcubic / r-shell.js
Last active May 17, 2020
JavaScript bookmark that can be used to open interactive R shell in shiny app
View r-shell.js
javascript:(function($) {
var handlers = [];
if (typeof Shiny !== 'undefined') {
Shiny.addCustomMessageHandler("__EVAL__", function(data) {
handlers.forEach(function(handler) {
var index = 0;
jcubic / module.js
Last active Sep 3, 2018
Module definition function with namespace and dependencies
View module.js
// -----------------------------------------------------------------------------
// Copyright (c) 2018 Jakub Jankiewicz
// Released under MIT license
// generic namespace generator the constructor should declare private functions
// and variables and return public api, the module is created when all dependecies
// are resolved (all modules are created)
// @param namespace dot separated namespace that will be added to window object
// @param dependencies array of string (dependencies) can be empty array
jcubic / cert
Last active Jun 21, 2020
Upload SSL Certificate to DirectAdmin controlled domains
View cert
sudo certbot certonly --manual --expand --manual-public-ip-logging-ok \
--preferred-challenges http -n \
--manual-auth-hook ./ --agree-tos --email <EMAIL ADRESS> 2>&1 | tee $output
grep "Certificate not yet due for renewal" $output > /dev/null || \
jcubic /
Created Feb 4, 2018
Simple HTTP server for static files
import socket
import re
import os
import threading
header_re = re.compile(r"(GET|POST) ([^ ]+) HTTP/", re.I)
def status(code):
jcubic / css.js
Created Jan 24, 2018
Monkey patch for jQuery css to handle custom properties aka css variables
View css.js
$.fn.css = (function(css) {
return function fn(key, value) {
var self = this;
if (arguments.length == 1 && $.isPlainObject(arguments[0])) {
var data = arguments[0];
Object.keys(data).forEach(function(key) {, key, data[key]);
} else if (key.match(/^\s*--/)) {
if (typeof value === 'undefined') {
jcubic / compile
Last active Jun 24, 2020
POC for Emscripten Async code + jQuery Terminal
View compile
emcc -o main.html -s FETCH=1 -s NO_EXIT_RUNTIME=0 main.c
jcubic / .htaccess
Last active Dec 22, 2017
Simple url shortener in php and sqlite
View .htaccess
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*) /index.php?$1
jcubic / shell.php
Created Dec 18, 2017
Simple jQuery Terminal based php shell
View shell.php
$_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && isset($_POST['cmd'])) {
<!DOCTYPE html>
jcubic /
Created Oct 22, 2017
Create sqlite data base from git repo commits
#!/usr/bin/env python
import git
import json
import sqlite3
import re
import os
import os.path
def log(repo):
You can’t perform that action at this time.