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
<?php | |
namespace k1; | |
class ViteAsset { | |
public $file = null; | |
public $src = null; | |
public $isEntry = false; | |
public $isDynamicEntry = false; |
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
const express = require('express') | |
const cors = require('cors') | |
const bodyParser = require('body-parser') | |
const session = require('express-session') | |
const redis = require('redis') | |
const RedisStore = require('connect-redis')(session) | |
const axios = require('axios') | |
const csurf = require('csurf') | |
const cookieParser = require('cookie-parser') | |
const listEndpoints = require('express-list-endpoints') |
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
not really |
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
xxx |
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
find Original -type d | sed 's/^Original/Resized/' | tr '\n' '\0' | xargs -0 mkdir -p | |
for f in (find Original -type f -name '*.png'); convert "$f" -resize 'x256>' (string replace Original Resized "$f"); end | |
# images need to be inside folder called Original, they will be sized to be 256 wide |
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
function onMouseMove(event, initialX: number, initialY: number) { | |
const { clientX, clientY, movementX, movementY } = event | |
const moving = { | |
left: movementX < 0 | |
right: movementX > 0 | |
up: movementY < 0 | |
down: movementY > 0 | |
} | |
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
const path = require("path"); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const ManifestPlugin = require("webpack-manifest-plugin"); | |
const WriteFilePlugin = require("write-file-webpack-plugin"); | |
const TerserJSPlugin = require("terser-webpack-plugin"); | |
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); | |
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer") | |
.BundleAnalyzerPlugin; |
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
// Below: Autogenerated types from Quicktype. They have been modified by hand. | |
// ACF fields in standard endpoints do not exist out of the box, you have to add them yourself. | |
// k1sul1/k1kit does that for you automagically. | |
// To parse this data: | |
// | |
// import { Convert, RawStoneData, Texts, Taxonomies, PostTypes, PostStatuses } from "./file"; | |
// | |
// const taxonomies = Convert.toTaxonomies(json); | |
// const tags = Convert.toTags(json); |
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
const rewire = require('rewire'); | |
const defaults = rewire('react-scripts/scripts/build.js'); | |
let config = defaults.__get__('config'); | |
config.optimization.splitChunks = { | |
cacheGroups: { | |
default: false, | |
}, | |
}; |
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
<?php | |
$post = $GLOBALS['post']; | |
$wpdb = $GLOBALS['wpdb']; | |
// :trollface: | |
// qtranslate is not a very nice tool | |
$id = (int) $post->ID; // No injections here | |
$raw = $wpdb->get_var("SELECT post_content from $wpdb->posts WHERE ID = $id"); | |
$extractor = function($lang = 'fi') use ($raw) { |
NewerOlder