This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity >= 0.6.0 < 0.9.0; | |
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; | |
contract ChristmasBets { | |
function placeBet() public payable { | |
} |
This file contains hidden or 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 | |
/** | |
* converts an array of rows to an array of columns | |
* @example | |
* $items = [ | |
* ['id' => 1, 'colour' => 'red'], | |
* ['id' => 2, 'colour' => 'orange'] | |
* ]; | |
* array_columnify($items); // ['id' => [1, 2], 'colour' => ['red', 'orange']] | |
* |
This file contains hidden or 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 | |
/** | |
* reduces items in given array to values of last item grouped by given column | |
* @example | |
* $items = [ | |
* ['animal' => 'rabbit', 'age' => 2], | |
* ['animal' => 'rabbit', 'age' => 8], | |
* ['animal' => 'dog', 'age' => 12], | |
* ['animal' => 'dog', 'age' => 1], |
This file contains hidden or 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 | |
/** | |
* groups given items by given column | |
* @param string $column column to group by | |
* @param array[object|array] $items items to group | |
* @return array[object|array] grouped items | |
*/ | |
function array_group_by($column, $items) { | |
$grouped = []; |
This file contains hidden or 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 YourPlugin; | |
define(__NAMESPACE__."\PATH", plugin_dir_path( __FILE__ )); | |
function add_fallback_archive_your_post_type_template($template) { | |
if(!is_post_type_archive('your_post_type')) return $template; | |
$themeTemplate = locate_template('archive-your-post-type.php'); |
This file contains hidden or 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 | |
function register_field_type($type, $options) { | |
foreach ($options as $key => $value) { | |
$filter = PRFX.$type.'_field_'.$key; | |
if(is_callable($value)) { | |
add_filter($filter, $value, 10, 3); | |
} else { | |
add_filter($filter, function() use ($value) { return $value; }, 10, 3); | |
} |
This file contains hidden or 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 wpAjax(method, action, params) { | |
return $.ajax($.extend(true, { | |
method: method, | |
url: ajaxUrl, | |
data: { | |
action: action | |
} | |
}, params)); | |
} |
This file contains hidden or 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
--- | |
version: 1.0 | |
domains: | |
- motoronefinance.dev.webmad.co.nz | |
url_patterns: | |
- motoronefinance.dev.webmad.co.nz/* | |
timestamp: '2018-07-30T23:06:52Z' | |
id: 9RfO | |
redirect_url: http://motoronefinance.dev.webmad.co.nz/?s=loan | |
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome |
This file contains hidden or 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
--- | |
version: 1.0 | |
domains: | |
- policies.webmad.co.nz | |
url_patterns: | |
- policies.webmad.co.nz/* | |
timestamp: '2018-07-30T22:32:09Z' | |
id: coQF | |
redirect_url: http://policies.webmad.co.nz/wp-login.php?redirect_to=http%3A%2F%2Fpolicies.webmad.co.nz%2Fwp-admin%2Fpost.php%3Fpost%3D495%26action%3Dedit&reauth=1 | |
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome |
This file contains hidden or 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
#! /usr/bin/env bash | |
echo -n '<h1>hello world</h1>' | lzma -9 | base64 | printf "https://itty.bitty.site/#%s/%s\n" "Title" "$(cat -) |
NewerOlder