Skip to content

Instantly share code, notes, and snippets.

@sareiodata
sareiodata / runner.html
Last active August 13, 2025 10:38
php web runner
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PHP Runner</title>
<style>
body { margin:0; font-family:sans-serif; display:flex; flex-direction:column; height:100vh; }
#editor, #output { flex:1; padding:8px; box-sizing:border-box; font-family:monospace; font-size:16px; width:100%; }
#output { overflow:auto; background:#f9f9f9; }
@sareiodata
sareiodata / compounding.html
Created February 6, 2025 07:55
Compounding Calculator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compounding Interest Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dividend Distribution Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
@sareiodata
sareiodata / wp_remove_assets.php
Last active January 23, 2024 16:43
WP Remove Assets
<?php
/*
* Plugin Name: WP Remove Assets
* Plugin URI: https://www.cozmsolabs.com
* Version: 0.1
* Description: Filter particular scripts and style to load in posts or pages that don't need it.
* Author: Cristian Antohe
* Author URI: https://www.cozmoslabs.com/
*/
var gulp = require('gulp'),
pot = require( 'gulp-wp-pot' ),
fs = require('fs'),
git = require('gulp-git');
var addons = [ 'pms-add-on-bbpress', 'pms-add-on-content-dripping', 'pms-add-on-discount-codes', 'pms-add-on-email-reminders',
'pms-add-on-global-content-restriction', 'pms-add-on-invoices', 'pms-add-on-member-subscription-fixed-period', 'pms-add-on-multiple-subscriptions-per-user'
, 'pms-add-on-navigation-menu-filtering', 'pms-add-on-paypal-express-pro', 'pms-add-on-paypal-standard-recurring-payments', 'pms-add-on-recaptcha'
, 'pms-add-on-stripe', 'pms-add-on-pay-what-you-want', 'pms-add-on-group-memberships', 'pms-add-on-tax' ];
@sareiodata
sareiodata / post-sitemap1.xml
Created February 18, 2020 07:51
xml sitemap with translated url's
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://tp.test/sitemaps_xsl.xsl"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://tp.test/blog/</loc>
<xhtml:link rel='alternate' hreflang='en-US' href='http://tp.test/blog/' />
<xhtml:link rel='alternate' hreflang='ro-RO' href='http://tp.test/ro/blog/' />
</url>
<url>
<loc>http://tp.test/ro/blog/</loc>
@sareiodata
sareiodata / gist:d0948bac308400eb7d90612b6cf1539c
Created November 6, 2019 13:21
Questions about Elm language
https://guide.elm-lang.org/effects/http.html
main =
Browser.element
{ init = init
, update = update
, subscriptions = subscriptions
, view = view
}
@sareiodata
sareiodata / gist:ad5909c20ede6d520ac0ea950f8054b4
Created September 26, 2019 12:15
nginx sareiodatadynamic servername
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
<?php
add_action( 'trp_before_running_hooks', 'trpc_remove_hooks_to_disable_gettext_translation', 10, 1);
function trpc_remove_hooks_to_disable_gettext_translation( $trp_loader ){
$trp_loader->remove_hook( 'init', 'create_gettext_translated_global' );
$trp_loader->remove_hook( 'shutdown', 'machine_translate_gettext' );
}
#!/bin/bash
# Version: 2.0
# Release: November 24, 2017
# Based on https://github.com/leehblue/texpander/
# Get window id, pass to getwindow pid to output the pid of current window
pid=$(xdotool getwindowfocus getwindowpid)
# Store text name of process based on pid of current window