This file contains 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 from 'react'; | |
import { View, Animated, Easing } from 'react-native'; | |
import { DeviceMotion } from 'expo-sensors'; | |
class AnimatedAnalyticsImage extends React.Component { | |
state = { | |
motionX: 0, | |
motionY: 0, | |
motionZ: 0 |
This file contains 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
{ | |
"workbench.preferredDarkColorTheme": "Seti Monokai", | |
"workbench.preferredHighContrastColorTheme": "Seti Monokai", | |
"window.zoomLevel": 0, | |
"workbench.colorCustomizations": { | |
"[Default Dark+]": { | |
"editor.background": "#161616", | |
"editorIndentGuide.background": "#2c2c2c", | |
"editor.selectionBackground": "#135564", |
This file contains 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 from 'react'; | |
import * as THREE from 'three'; | |
import { TrackballControls } from 'three/examples/jsm/controls/TrackballControls.js'; | |
class Scene extends React.Component { | |
constructor(props) { | |
super(props) | |
this.animate = this.animate.bind(this); |
This file contains 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
Options -MultiViews | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.html [QSA,L] |
This file contains 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
// get app bundle id | |
osascript -e 'id of app "Calendar"' | |
// update theme | com.apple.iCal is App's bundle identifier | |
defaults write com.apple.iCal NSRequiresAquaSystemAppearance -bool yes |
This file contains 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
// Upload image using http POST & Google Cloud Storage API | |
var uploadUrl = 'https://www.googleapis.com/upload/storage/v1/b/wkndevents/o?uploadType=media&name=loremipsum.jpg'; // upload with direct HTTP call | |
var tmp_auth = 'Bearer tokenhere123'; // Get Bearer Access token here - https://developers.google.com/oauthplayground | |
// Enable access for Cloud Storage v1 & Cloud Storage JSON API | |
var fileinput = $('.file-upload-input')[0]; // <input type='file'> | |
var file = fileinput.files[0]; // just support 1st file for now | |
// post image into google cloud storage |
This file contains 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
componentDidUpdate(prevProps, prevState) { | |
if (this.state !== prevState) { | |
// update redux state when Information.js state updates | |
this.props.updateNewEventInfo(this.state); | |
} | |
if (prevProps.eventcreation !== this.props.eventcreation) { | |
// redux prop is updated in component prop (slight delay between redux / prop updates) | |
} | |
} |
This file contains 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
switch (uniform.type) | |
{ | |
case 'b': | |
case 'bool': | |
case 'boolean': | |
// single int value | |
case 'i': | |
case '1i' |
This file contains 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
// Connect | |
function connect() { | |
var mongoose = require('mongoose'); | |
mongoose | |
.connect('mongodb://user:[email protected]:1234/project', { | |
useNewUrlParser: true | |
}) | |
.then(() => { | |
console.log('MongoDB Connected'); |
This file contains 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
// Fetches SQL table through ajax POST | |
// console.logs rows as JSON | |
// =============================== PHP (functions.php) | |
<?php | |
add_action( 'wp_ajax_clients', 'sql_get_clients' ); | |
add_action( 'wp_ajax_nopriv_clients', 'sql_get_clients' ); // postman (if user not logged in) | |
function sql_get_clients() { |
NewerOlder