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 isJSON(str) { | |
| if (typeof str !== "string") { | |
| return false; | |
| } | |
| var char = str.charAt(0); | |
| if (char != "[" && char != "{") { | |
| return false; | |
| } | |
| try { | |
| return typeof JSON.parse(str) === 'object'; |
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
| @reboot screen -d -m ~/startup.sh |
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
| #!/bin/bash | |
| sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 | |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://ftp.ddg.lth.se/mariadb/repo/10.3/ubuntu bionic main' | |
| curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - | |
| sudo apt-get -y update |
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 View($file, array $args = []) { | |
| extract($args); | |
| ob_start(); | |
| if (file_exists($file)) { | |
| include $file; | |
| return ob_get_clean(); | |
| } | |
| } | |
| ?> |
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 | |
| register_post_type("example", [ | |
| "labels" => [ | |
| "name" => "Examples", | |
| "singular_name" => "Example" | |
| ], | |
| "show_ui" => true, | |
| "supports" => [ | |
| "title", | |
| "editor", |
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 path($file = "") { | |
| return get_template_directory_uri() . "/$file"; | |
| } | |
| ?> |
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
| String.prototype.wrap = function(str) { | |
| return "" + str + this + str; | |
| }; |
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
| <div class="square"> | |
| <div class="square-content"> | |
| Hello world! | |
| </div> | |
| </div> |
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
| var Example = | |
| typeof window === "undefined" ? this | |
| : window.Example = {}; | |
| Example.foo = function() { | |
| return 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
| function hex(r, g, b) { | |
| var hex = "#"; | |
| if (Array.isArray(r)) { | |
| var rgb = r; | |
| r = rgb[0]; | |
| g = rgb[1]; | |
| b = rgb[2]; | |
| } | |
| var rgb = [ | |
| r || 0, |