View claraio
## Change Visiblity on an Object
```
// visible
api.scene.setAll({ name: 'object_name', plug: 'Properties', property: 'visible' }, true);
// invisible
api.scene.setAll({ name: 'object_name', plug: 'Properties', property: 'visible' }, false);
```
## Get All Materials
```
View Sort.js
array.sort(function(a, b) {
return a.prop - b.prop;
});
View PHP Browser User Agent Device
<?php
function get_browser_name($user_agent)
{
if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera';
elseif (strpos($user_agent, 'Edge')) return 'Edge';
elseif (strpos($user_agent, 'Chrome')) return 'Chrome';
elseif (strpos($user_agent, 'Safari')) return 'Safari';
elseif (strpos($user_agent, 'Firefox')) return 'Firefox';
elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer';
View lightsail
### Check Admin Password
```
cat bitnami_application_password
```
### Accessing PhpMyAdmin on Linux and Mac OSX
```
ssh -N -L 8888:127.0.0.1:80 -i KEYFILE bitnami@SERVER-IP
View .htaccess
#### Forward entire domain
```
RedirectMatch 301 ^(.*)$ http://www.valenciamorganhill.com/
```
#### Forward entire domain alt.
```
RewriteEngine On
RewriteBase /
View gulpfile.js
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var plumber = require('gulp-plumber');
View functions.php
add_action('init', 'create_units_post_type');
function create_units_post_type() {
$labels = array(
'name' => __('Site Plan'),
'singular_name' => __('Unit'),
'all_items' => __('All Units'),
'add_new' => _x('Add new Unit', 'Unit'),
'add_new_item' => __('Add new Unit'),
View gulpfile-old.js
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
View api.js
const express = require('express');
const router = express.Router();
const db = require('./../db/db.js');
router.get('/projects', (req, res) => {
console.log('you hit projects');
Project.find(function (err, projects) {
if(!err) {
console.log(projects);
res.json(projects);
View files.ts
filebuttoni(event) {
let files = event.srcElement.files[0];
let self = this;
let uploader = document.getElementById("uploader");
this.path = "user-profile-pics/"+files.name;
this.storageref = this.storage.child(this.path);
let uploadTask = this.storageref.put(files);
uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, function(snapshot) {
let progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;