Create a folder to store the databases :
mkdir -p /usr/share/GeoIP
Download Country IP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
function createApi(baseUrl, defaults = {}) { | |
const callable = () => {} | |
callable.url = baseUrl | |
return new Proxy(callable, { | |
get({ url }, key) { | |
const method = key.toUpperCase() | |
if (['GET', 'POST', 'PUT', 'DELETE', 'PATCH'].includes(method)) { | |
return (data, overrides = {}) => { | |
const payload = { method, ...defaults, ...overrides } | |
switch (method) { |
import { createApp } from './dist/app.mjs' | |
import { pipeToWebWritable } from 'vue/server-renderer' | |
const prepend = String.raw`<!doctype html> | |
<html lang="en"> | |
<title>Title</title> | |
<div id="app">` | |
const append = String.raw`</div> | |
<script type="importmap"> |
import path from 'node:path' | |
import { loadEnv } from 'vite' | |
export default ({ mode }) => { | |
return { | |
env: Object.assign(process.env, loadEnv(mode, process.cwd())) | |
} | |
} |
import { createServer } from 'node:http' | |
import { createHmac } from 'node:crypto' | |
import { Printer, InMemory, Drawer, Style, Align, Model } from 'escpos-buffer' | |
const { | |
PORT = 3000, | |
HOST = 0, | |
GITHUB_WEBHOOK_SECRET, | |
PRINTER_MODEL = 'TM-T20', | |
PRINTER_COLUMNS = 56 |
'use strict' | |
const timeout = ms => new Promise(res => setTimeout(res, ms)) | |
function convinceMe (convince) { | |
let unixTime = Math.round(+new Date() / 1000) | |
console.log(`Delay ${convince} at ${unixTime}`) | |
} | |
async function delay () { |
<?php | |
add_filter('rest_pre_echo_response', function($response, $object, $request) { | |
$post_id = $response['id']; | |
$type = get_post_type($post_id); | |
$from_post = $request->get_param('from_post'); | |
if ($from_post && $type === 'hotels') { | |
pll_set_post_language($post_id, 'de'); | |
pll_set_post_language($from_post, 'en'); | |
pll_save_post_translations(array( |
Create a folder to store the databases :
mkdir -p /usr/share/GeoIP
Download Country IP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
<template> | |
<div id="app" :style="cssVariables"> | |
<label>wdth</label> | |
<input type="range" min="10" max="700" v-model="wght"> | |
<label>wght</label> | |
<input type="range" min="10" max="100" v-model="wdth"> | |
<span>The quick brown fox jumps over the lazy dog</span> | |
</div> | |
</template> |
<?php | |
/** | |
* Global Trade Identification Numbers (GTINs) to WooCommerce products. | |
* Render the Global Trade Identification Number (GTIN) meta field. | |
*/ | |
function woocommerce_render_gtin_field() { | |
$input = array( | |
'id' => '_gtin', | |
'label' => sprintf( | |
'<abbr title="%1$s">%2$s</abbr>', |
<script> | |
export default { | |
computed: { | |
theme () { | |
const [color, backgroundColor] = this.$store.state.theme | |
return { | |
'--color': color, | |
'--background-color': backgroundColor | |
} | |
} |