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
| // This example demonstrates how to use the Prover to acquire an attestation for | |
| // an HTTP request sent to jsonplaceholder.typicode.com. The attestation and secrets are | |
| // saved to disk. | |
| use http_body_util::Empty; | |
| use hyper::{Request, StatusCode, body::Bytes}; | |
| use hyper_util::rt::TokioIo; | |
| use tokio::{ | |
| io::{AsyncRead, AsyncWrite}, | |
| sync::oneshot::{self, Receiver, Sender}, |
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
| import { ethers } from 'ethers'; | |
| // Inspired by: https://medium.com/@hanyi.lol/how-to-get-a-block-number-by-timestamp-fefde4c69162 | |
| export async function getClosestBlockByTime( | |
| timestamp: number, | |
| provider: ethers.Provider | |
| ) { | |
| let maxBlockNumber = await provider.getBlockNumber(); | |
| let minBlockNumber = 0; | |
| const maxBlock = await provider.getBlock(maxBlockNumber); |
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
| import { | |
| AuthProvider, | |
| asOldCaipString, | |
| getConsentMessage, | |
| LinkProof | |
| } from "@ceramicnetwork/blockchain-utils-linking"; | |
| import { AccountId } from "caip"; | |
| import * as uint8arrays from "uint8arrays"; | |
| export class ArweaveAuthProvider implements AuthProvider { |
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 | |
| /** | |
| * @package env-plugin-manager | |
| * @version 1.0 | |
| * | |
| * Plugin Name: Environment Plugin Manager | |
| * Description: This plugin manages the activation of other plugins based on the website's environment | |
| * Version: 1.0 | |
| * Author: Ryan Soury | Web Doodle |
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 | |
| /** | |
| * Standalone function used by Flatesome Search Filter | |
| * | |
| * @param string $search_query | |
| * @param array $args | |
| * @param array $defaults | |
| * @return array | |
| */ |
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
| const path = require("path"); | |
| const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
| const StyleLintPlugin = require("stylelint-webpack-plugin"); | |
| const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin"); | |
| const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | |
| const ImageminPlugin = require("imagemin-webpack-plugin").default; | |
| const TerserPlugin = require("terser-webpack-plugin"); | |
| const CopyPlugin = require("copy-webpack-plugin"); | |
| const { NODE_ENV: mode = "development" } = process.env; |
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
| import React, { useEffect } from "react"; | |
| import Frame, { FrameContextConsumer } from "react-frame-component"; | |
| import { iframeResize } from "iframe-resizer"; | |
| import iFrameResizeContentWindowScript from "!raw-loader!iframe-resizer/js/iframeResizer.contentWindow.min.js"; // eslint-disable-line | |
| const SmartFrame = ({ children, ...props }) => { | |
| const ref = React.createRef(); | |
| // Component did mount | |
| useEffect(() => { |
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 your_shortcode_function( $atts ){ | |
| // $atts in case you want to receive attributes | |
| // This lets you set default results for attributes that aren't provided. | |
| $attributes = shortcode_atts(array( | |
| "text" => "some text", | |
| "link" => "Some link" | |
| ), $atts); |
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(window, document){ | |
| var load = function(){ | |
| var script = document.createElement('script'); | |
| script.async = true; | |
| script.type = 'text/javascript'; | |
| script.src = 'THE_SOURCE_OF_JS_LIB_HERE.js'; | |
| var firstScript = document.getElementsByTagName('script')[0]; | |
| firstScript.parentNode.insertBefore(script, firstScript); | |
| }; | |
| if(document.readyState === "complete"){ |
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
| [ | |
| { "keys": ["super+shift+o"], "command": "prompt_add_folder" }, | |
| { "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context": | |
| [ | |
| { "key": "selector", "operator": "equal", "operand": "(text.html, text.xml, meta.jsx.js) - string - comment", "match_all": true }, | |
| { "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true }, | |
| { "key": "setting.auto_close_tags" } | |
| ] | |
| }, | |
| {"keys": ["alt+shift+f"], "command": "reindent", "args": {"single_line": false}} |
NewerOlder