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 | |
| // This class has functionality which can be used by many other classes. | |
| class CommonFunctionalityClass { | |
| function doSomethingCommon() { | |
| $this->supportingFunction(); | |
| } | |
| function supportingFunction() { | |
| echo(“hi”); | |
| } |
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 | |
| @include_once('patches.php'); // This has some custom patches for our Archon. | |
| require_once('includes.inc.php'); | |
| require_once("packages/digitallibrary/lib/file.inc.php"); | |
| $query = "select id, length(FileContents) as fcsize, length(FilePreviewLong) as fplsize, length(FilePreviewShort) as fpssize from tblDigitalLibrary_Files where id=?"; // and (length(FileContents)=length(FilePreviewLong) or length(FileContents)=length(FilePreviewShort))"; | |
| $prep = $_ARCHON->mdb2->prepare($query, array('integer'), MDB2_PREPARE_RESULT); | |
| function needsResizing($id) { | |
| global $prep; |
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
| # show ip address for ssh host, with zsh completion for hostname | |
| _sship () { ssh -G $1 | awk '/^hostname/ {print $2}' } | |
| compdef _sship=ssh | |
| # Usage | |
| # ===== | |
| # Add the above two lines to the bottom of your ~/.zshrc file. | |
| # | |
| # Use it like this on the commandline: |
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
| require "json" | |
| require "net/http" | |
| url = "https://mainnet.era.zksync.io" | |
| pp JSON.parse(Net::HTTP.post(URI.parse(url), {"method": "eth_blockNumber", "params": [], "id":1, "jsonrpc":"2.0"}.to_json, "Content-Type" => "application/json").body) | |
| # => {"jsonrpc"=>"2.0", "result"=>"0x22d9d5d", "id"=>1} |
OlderNewer