Skip to content

Instantly share code, notes, and snippets.

View JWPapi's full-sized avatar
🎆

Julian M. Wagner JWPapi

🎆
View GitHub Profile
@JWPapi
JWPapi / bets.js
Created September 25, 2020 20:09
console.log(result)
/*
{
_id: 5f6e2ef1ecc6f0402afbbccb,
owner_id: '5f6e2ed8ecc6f0402afbbcca',
name: 'Schmid gewinnt gegen Wagner Tischtennis',
odds: 3,
backing: 200,
accepted: false,
betSchema.virtual('toWin').get(function() {
return Number(this.backing/this.odds + this.backing/this.odds/this.odds).toFixed(2)
})
!==
betSchema.virtual('toWin').get(() => Number(this.backing/this.odds + this.backing/this.odds/this.odds).toFixed(2))
bets.map((bet) => {
user.find({_id: bet.owner}, (err,user) => {
bet.ownerObj = user
})
})
class Plugins_Disabler {
/**
* Maps the plugins to disable in a given URL regex match.
*
* @var array
*/
private static $url_plugin_map = [
'/?wc-ajax=update_order_review' => ['bh-wp-account-and-login-ux/bh-wp-account-and-login-ux.php'],
];
<?php
if ( ! function_exists( 'passim_include_comments_in_templates' ) ) {
/**
* Function which includes comments templates on pages/posts
*/
function passim_include_comments_in_templates() {
// Include comments template
comments_template();
@media(max-width: 1440px) {
.elementor-tabs .elementor-tab-mobile-title.elementor-tab-mobile-title {
border-style: solid;
display: block;
}
.elementor-widget-tabs .elementor-tabs-wrapper {
display:none;
}
}
<button class="CTA hover:bg-gold-light focus:bg-gold-light bg-gold text-black mt-8 py-4 px-16 text-xl md:text-3xl font-bold uppercase font-bold mb-4 rounded inline-block mx-auto drop-shadow-lg">
SIGN ME UP
</button>
<?php
class myTheme {
public static function button($size,$text): string {
return '<button class="CTA hover:bg-gold-light focus:bg-gold-light bg-gold text-black mt-8 py-4 px-16 text-xl md:text-3xl font-bold uppercase font-bold mb-4 rounded inline-block mx-auto drop-shadow-lg">
<div class="grid">
<div class="flex flex-col">
<div class="flex">
<h5 class="bg-gold inline-block font-bold rounded-t-2xl text-lg md:text-2xl px-4 py-1 uppercase">
Lighting 1</h5>
</div>
<div class="bg-primary p-4 flex flex-col justify-between mb-8 shadow-md flex-grow">
<div>
<h5 class="text-white text-2xl md:text-4xl font-display uppercase tracking-tight mb-4">
The Studio Shoot</h5>
<div class="grid">
<?php grid_card('Lighting 1', 'The Studio Shoot', 'Learn the fundamentals of light in a studio environment', '/images/pro/images/shoot.jpg'); ?>
<?php grid_card('Lighting 2', 'The Studio Shoot', 'Learn the fundamentals of light in a studio environment', '/images/pro/images/shoot.jpg'); ?>
<?php grid_card('Lighting 2', 'The Studio Shoot', 'Learn the fundamentals of light in a studio environment', '/images/pro/images/shoot.jpg'); ?>
<?php grid_card('Lighting 2', 'The Studio Shoot', 'Learn the fundamentals of light in a studio environment', '/images/pro/images/shoot.jpg'); ?>
<?php grid_card('Lighting 2', 'The Studio Shoot', 'Learn the fundamentals of light in a studio environment', '/images/pro/images/shoot.jpg'); ?>
<?php grid_card('Lighting 2', 'The Studio Shoot', 'Learn the fundamentals of light in a studio environment', '/images/pro/images/shoot.jpg'); ?>
<?php grid_card('Lighting 2', 'The Studio Shoot', 'Learn the fundamentals of light in a studio environment', '/images/pro/ima
@JWPapi
JWPapi / Generate additional Subtitles Facebook
Created January 27, 2022 16:42
Spread out spanish, chinese, french and portuguese country codes
const fs = require('fs')
const translationsGroups = [
['fr_FR','fr_CA'],
['es_ES','es_MX','es_CL','es_CO','eu_ES','es_PE','es_UY','es_VE','gl_ES'],
['pt_BR','pt_PT'],
['zh_CN','zh_TW','zh_HK']
]
const copyTranslation = (inputCountryCode, outputCountryCode, file) => fs.copyFileSync(file, file.replace(inputCountryCode, outputCountryCode, fs.constants.COPYFILE_EXCL))
const copyTranslationForGroup = (file, translationsGroup, inputCountryCode) => translationsGroup.forEach(translation => copyTranslation(inputCountryCode, translation, file))