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
/**@license | |
* ___ ___ _____ __ __ _ _____ _ _ | |
* / __|_ _|_ _| \ \ / /__| |__ |_ _|__ _ _ _ __ (_)_ _ __ _| | | |
* | (_ || | | | \ \/\/ / -_) '_ \ | |/ -_) '_| ' \| | ' \/ _` | | | |
* \___|___| |_| \_/\_/\___|_.__/ |_|\___|_| |_|_|_|_|_||_\__,_|_| | |
* | |
* this is service worker and it's part of GIT Web terminal | |
* | |
* Copyright (c) 2018 Jakub Jankiewicz <http://jcubic.pl/me> | |
* Released under the MIT license |
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
// --------------------------------------------------------------------------- | |
// :: execute callback function when shiny output element is modified | |
// :: the callback can be called multiple times if you use option onTime: false | |
// :: you can also use check option with function that will be check if | |
// :: before executing callback and removing observer | |
// --------------------------------------------------------------------------- | |
$.fn.onRender = function(callback, options) { | |
if (this.length === 0) { | |
throw new Error("Element doesn't exists! Try to wait until it's added to DOM."); | |
} |
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
#!/bin/bash | |
output=$(mktemp); | |
sudo certbot certonly --manual --expand --manual-public-ip-logging-ok \ | |
--preferred-challenges http -n \ | |
-d <LIST OF COMMA SEPARATED DOMAINS AND SUBDOMAINS>\ | |
--manual-auth-hook ./cert.py --agree-tos --email <EMAIL ADRESS> 2>&1 | tee $output | |
grep "Certificate not yet due for renewal" $output > /dev/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
/* | |
3x3 2D Matrix | |
[a c e] | |
[b d f] | |
[0 0 1] | |
*/ | |
var DOMException = require('domexception'); |
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
javascript:(function(next) { | |
/** | |
* Bookmarklet that will create terminal with ANSI rendering | |
* on 16colo.rs website (individual ANSI file) | |
* | |
* Copyright (C) Jakub T. Jankiewicz <https://jcubic.pl> | |
* Released under MIT license | |
*/ | |
if (window.jQuery) { | |
return next(window.jQuery); |
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
import java.io.*; | |
import java.util.*; | |
import javax.servlet.*; | |
import javax.servlet.http.*; | |
import java.lang.reflect.*; | |
import com.thetransactioncompany.jsonrpc2.*; | |
public class init extends HttpServlet { | |
public init() { |
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 python | |
import git | |
import json | |
import sqlite3 | |
import re | |
import os | |
import os.path | |
def log(repo): |
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
$.fn.crossDomainRequest = function(url, method, data, fn) { | |
var self = this; | |
var receiver = self.attr('src').replace(/\/.*$/, '').replace(/^https?::\/\//, ''); | |
function get(event) { | |
if (event.origin.match(receiver)) { | |
// event.data is response from POST | |
fn(event.data); | |
} | |
} | |
if (window.addEventListener){ |
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
// ----------------------------------------------------------------------------- | |
// 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 |
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/python | |
import socket | |
import re | |
import os | |
import threading | |
header_re = re.compile(r"(GET|POST) ([^ ]+) HTTP/", re.I) | |
def status(code): |