Skip to content

Instantly share code, notes, and snippets.

View evo42's full-sized avatar

Rene Kapusta evo42

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 8, 2024 06:20
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
var passwordcred = new PasswordCredential({
'type': 'password',
'id': 'alice',
'password': 'VeryRandomPassword123456'
})
navigator.credentials.store(passwordcred)
@geek-at
geek-at / easybank.class.php
Created April 3, 2018 19:33
php wrapper for read only access to easybank.at
<?php
/*
* EasyBank.at client lib
* Reverse engineered by looking at the API calls of the app
*
* Example usage:
*
* <?php
* include_once('easybank.class.php');
pragma solidity ^0.4.11;
// @calvin_claus' contract
// @neuling2k didn't do anything
contract CryptoLambo {
address public dev1;
address public dev2;
@hagemann
hagemann / slugify.js
Last active October 30, 2023 09:10
Slugify makes a string URI-friendly
function slugify(string) {
const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;'
const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
@raecoo
raecoo / console.save.js
Last active April 25, 2024 13:19
Save JSON object to file in Chrome Devtool
// e.g. console.save({hello: 'world'})
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4)
@gedex
gedex / woocommerce-shipment-tracking-rest-api-doc.md
Last active March 21, 2020 09:05
WooCommerce Shipment Tracking REST API introduced in 1.5.0

Shipment Tracking REST API

The shipment tracking REST API allows you to create, view, and delete individual shipment tracking. The endpoint is /wp-json/wc/v1/orders/shipment-trackings.

Shipment Tracking Properties

Attribute Type Description
tracking_id string Unique identifier for shipment tracking read-only
tracking_number string Tracking number required
@zoernert
zoernert / microdao.abi
Last active June 19, 2017 10:13
Micro DAO to create an EVU in Germany
[ { "constant": true, "inputs": [], "name": "name", "outputs": [ { "name": "", "type": "string", "value": "MicroDAO" } ], "type": "function" }, { "constant": false, "inputs": [], "name": "executeSpendingRequests", "outputs": [], "type": "function" }, { "constant": false, "inputs": [ { "name": "number_of_days", "type": "uint256" }, { "name": "requiredShares", "type": "uint256" } ], "name": "setDirectorLock", "outputs": [], "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "bookings", "outputs": [ { "name": "time", "type": "uint256" }, { "name": "funding", "type": "uint256" }, { "name": "spending", "type": "uint256" }, { "name": "counterpart", "type": "address" }, { "name": "text", "type": "string" } ], "type": "function" }, { "constant": false, "inputs": [], "name": "closeFunding", "outputs": [], "type": "function" }, { "constant": false, "inputs": [ { "name": "node", "type": "string" } ], "name": "setDirectorNode", "outputs": [], "type": "function" }, { "consta
@hassy
hassy / parse_aws.md
Last active January 17, 2024 04:11
Deploying Parse Server on AWS (WIP)

Deploying Parse Server on AWS

Note: this is a work-in-progress and will be updated with more information over the next few days.

Intro

This guide will walk you through deploying your own instance of the open-source Parse Server. This would be a good starting point for testing your existing application to see if the functionality provided by the server is enough for your application, and to potentially plan your migration off the Parse Platform.

This guide will walk you through using Elastic Beanstalk (EB), which is an AWS service similar to Heroku. Why use EB rather than Heroku? Elastic Beanstalk does not lock you into Heroku-specific ways of doing things, is likely cheaper to run your backend on than Heroku, and it integrates with other services that AWS offer (and they offer almost everything one needs to run an application these days).

@jdiaz5513
jdiaz5513 / ascii_arty.py
Last active December 30, 2023 02:32
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor