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
RaycastHit hit; | |
bool foundRoad = false; | |
bool playerIsInFront = false; | |
Vector3 current = new Vector3(gameObject.transform.position.x, 5, gameObject.transform.position.z); | |
Vector3 aheadWorld = new Vector3(0, -5, 15); | |
Vector3 leftWorld = new Vector3(-15, -5, 0); | |
Vector3 rightWorld = new Vector3(15, -5, 0); | |
Vector3 behindWorld = new Vector3(0, -5, -15); |
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
<?php | |
for ( $x=1 ; $x<=100 ; $x++ ) { | |
if ( ( fmod($x,3) == 0 ) && ( fmod($x,7) == 0 ) ) { | |
echo "<span style='color:#ff0000'>Both</span><br/>" ; | |
} else if ( fmod($x,3) == 0 ) { | |
echo "<span style='color:#00ff00'>Three</span><br/>" ; | |
} else if ( fmod($x,7) == 0 ) { | |
echo "<span style='color:#0000ff'>Seven</span><br/>" ; | |
} else { | |
echo $x . "<br/>" ; |
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
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css" /> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Work+Sans:400,100,200,300,500,600,700,800,900" type="text/css" /> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" /> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Arvo:400,400italic,700,700italic" type="text/css" /> | |
<link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.blue_grey-amber.min.css" /> | |
<style> |
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
/* | |
* Example for adding images to Google Cloud Storage using NodeJS. | |
* This integrates with Firebase, you just need to download the keyfile. | |
* Firebase project > Settings > Firebase Admin SDK > Generate new private key. | |
* Don't forget to install dependancies: "yarn add bluebird @google-cloud/storage" | |
*/ | |
const projectId = 'xxx' | |
const bucketName = projectId+'.appspot.com' | |
const Promise = require('bluebird'); | |
const GoogleCloudStorage = Promise.promisifyAll(require('@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
import { AsyncStorage } from 'react-native'; | |
export const actionMethod = () => { | |
return (dispatch, getState) => { | |
(async () => { | |
try { | |
const value = await AsyncStorage.setItem('@YourStore:key', '12345'); | |
if (value !== null) { | |
// Value of the stored token |
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
#! /usr/bin/env node | |
// Resume our input from the console | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
// Receive some data | |
process.stdin.on('data', function (text) { | |
// Split the string arguments | |
const receivedInputArguments = text.replace(/\n$/, '').split(' '); |
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
/* | |
* System for generating x number of unique numbers and writing that to a CSV | |
* document. Good for competitions or anything requiring true unique numbers. | |
* Also an interesting exercise for Node/Javascript perf. | |
*/ | |
const fs = require('fs'); | |
const numbers = []; | |
const start = 111111111; // We don't want any leading 0's | |
const end = 999999999; | |
const amount = 3000000; |
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 ReactDOM from 'react-dom'; | |
export default class HQueue extends React.Component<any, any> { | |
constructor(props: any) { | |
super(props); | |
} | |
public componentDidMount() { | |
} |
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
/* | |
* Example of making an async React Native call to a .NET Web API 2 project. | |
* Helped with this issue a few times now.. Note the content type. | |
*/ | |
(async () => { | |
// Make the API call | |
fetch(constants.API_ROUTE+'Token', { | |
method: 'POST', | |
headers: {'Content-Type': 'application/x-www-form-urlencoded'}, |