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
| // Modules | |
| const cors = require('cors'), | |
| cron = require('node-cron'), | |
| express = require('express'), | |
| expressStaticGzip = require("express-static-gzip"), | |
| path = require('path'), | |
| request = require('request'), | |
| THREE = require('three'), | |
| app = express(), | |
| // Globals |
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
| updateVelocities(){ | |
| // Convert Degrees to Radians | |
| const rollRads = this.roll < 0 ? this.getRadians( 150-this.roll ) : this.getRadians( 150+this.roll ) , // Hypothetically 90-this.roll, changed for better playability | |
| pitchRads = this.pitch < 0 ? this.getRadians( 150-this.pitch ) : this.getRadians( 150+this.pitch ), // Hypothetically 90-this.pitch, changed for better playability | |
| gravSimY = this.aY/this.weight, | |
| yawRatio = this.yaw/this.maxYaw; | |
| // Rotational Velocity | |
| this.vR = this.aX * yawRatio; |
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
| // ENQUEUE FILES | |
| add_action('wp_enqueue_scripts', 'enqueue_func'); | |
| function enqueue_func() { | |
| wp_register_style( 'styles', get_template_directory_uri().'/css/styles.css' ); | |
| wp_register_style( 'bootstrapAndStyles', get_template_directory_uri().'/css/assets.css' ); | |
| wp_enqueue_script( 'jquery' ); | |
| wp_register_script( 'archive-script', get_template_directory_uri().'/js/index.js', array("jquery"), null, true ); | |
| wp_enqueue_script( 'archive-script' ); | |
| } |
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
| fetch("https://www.mystrainconnect.com:8081/getAllUsers", | |
| { | |
| method: "GET", | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| } | |
| }).then(res => res.json()) | |
| .catch(error => console.error('Error:', error)) | |
| .then(response => { | |
| console.log('Success:', response); |
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 quote_func($atts, $content = null){ | |
| $quote_attrs = shortcode_atts( array( | |
| 'logo' => 'Client Logo', | |
| ), $atts, 'quote' ); | |
| $output = "<div class='quote'><p class='text'>".$content."</p><div class='logo'>".wp_kses_post($quote_attrs["logo"])."</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
| function ajax_load_back() { | |
| $post_id = $_POST[ 'post_id' ]; | |
| $the_post = get_post( $post_id, OBJECT); | |
| $title = get_the_title($post_id); | |
| $post = $the_post->post_content; | |
| $text_content = preg_replace('/<img[^>]+./','', $post); | |
| // $attachments = get_posts( | |
| // array( 'post_type' => 'attachment', | |
| // 'numberposts' => -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
| $("#countdown").countdown("2016/08/01 12:34:56").on('update.countdown', function(event) { | |
| var d = '%D days', | |
| h = '%H hours', | |
| m = '%M minutes', | |
| s = '%S seconds'; | |
| if(event.offset.days > 0) { d = '%-d day%!d'; } | |
| if(event.offset.hours > 0) { h = '%-h hour%!h'; } | |
| if(event.offset.minutes > 0) { m = '%-m minute%!m'; } |
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
| // Read to end first, then solve one by one. | |
| var express = require('express'); | |
| // #0. Load 'multer' here. | |
| var mul = require('multer'); | |
| // #1. Use folder 'uploads' for multer's upload here. | |
| var storage = mul.diskStorage({ | |
| destination: function(req, file, cb){ |
NewerOlder