For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
t = 236 # seconds | |
Time.at(t).utc.strftime("%H:%M:%S") | |
=> "00:03:56" | |
# Reference | |
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. |
public static float Noise3D(float x, float y, float z, float frequency, float amplitude, float persistence, int octave, int seed) | |
{ | |
float noise = 0.0f; | |
for (int i = 0; i < octave; ++i) | |
{ | |
// Get all permutations of noise for each individual axis | |
float noiseXY = Mathf.PerlinNoise(x * frequency + seed, y * frequency + seed) * amplitude; | |
float noiseXZ = Mathf.PerlinNoise(x * frequency + seed, z * frequency + seed) * amplitude; | |
float noiseYZ = Mathf.PerlinNoise(y * frequency + seed, z * frequency + seed) * amplitude; |
// Example Scriptable Object. Instance must be placed in Resources folder and have the same name as the class, type of generic parameter must be your class. | |
using UnityEngine; | |
[CreateAssetMenu(fileName = "MySingletonSO")] | |
public class MySingletonSO : SingletonScriptableObject<MySingletonSO> | |
{ | |
// Here goes your data. This class can be called by the static Instance property, which will automatically locate the instance in the Resources folder. | |
} |
For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
#!/usr/bin/env bash | |
set -e | |
TEMPORARY="vue-docs.md" | |
GUIDE_PATH="./src/guide/" | |
OUTPUT_EPUB="vue-docs.epub" | |
OUTPUT_HTML="vue-docs.html" | |
git clone --depth=1 https://github.com/vuejs/docs |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
require 'gosu' | |
class GameWindow < Gosu::Window | |
def initialize | |
super 640, 480, false | |
self.caption = "Gosu Tutorial Game" | |
@font = Gosu::Font.new(self, Gosu::default_font_name, 20) | |
end |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] | |
Rehearsal ------------------------------------------ | |
MD5 1.010000 0.000000 1.010000 ( 1.026340) | |
SHA1 1.710000 0.000000 1.710000 ( 1.724464) | |
SHA2 3.780000 0.000000 3.780000 ( 3.824757) | |
SHA256 3.460000 0.010000 3.470000 ( 3.498111) | |
--------------------------------- total: 9.970000sec | |
user system total real | |
MD5 1.020000 0.000000 1.020000 ( 1.025751) |
def lerp(start, stop, step) | |
(stop * step) + (start * (1.0 - step)) | |
end |