In the apps config/puma.rb
file:
Change to match your CPU core count
# Check using this on the server => grep -c processor /proc/cpuinfo
workers 4
# Min and Max threads per worker
threads 1, 6
app_dir = File.expand_path('../..', FILE)
In the apps config/puma.rb
file:
Change to match your CPU core count
# Check using this on the server => grep -c processor /proc/cpuinfo
workers 4
# Min and Max threads per worker
threads 1, 6
app_dir = File.expand_path('../..', FILE)
const path = require('path'); | |
module.exports = { | |
mode: "development", | |
entry: { | |
'polyfill': '@babel/polyfill', | |
'kintone-create-edit-show': './src/kintone-create-edit-show.js' | |
}, | |
module: { | |
rules: [ |
# list disks: | |
diskutil list | |
# use disk name from the listed isntead of disk3 | |
# unmount your external drive: | |
diskutil unmountDisk force disk3 | |
# format in HFS with the name you want: | |
diskutil partitionDisk disk3 GPT JHFS+ "Drive Name" 0g |
I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.
For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.
Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.
One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.css' rel='stylesheet' /> | |
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' /> |
// Ruby = 5.times { |i| puts i } | |
// JS = (1).times(function(i){console.log(i);}) | |
Number.prototype.times = function(cb) { | |
var i = -1; | |
while (++i < this) { | |
cb(i); | |
} | |
return +this; |
brew tap homebrew/versions | |
brew install v8-315 | |
gem install libv8 -v '3.16.14.13' -- --with-system-v8 | |
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 | |
bundle install |
Rails Singleton Model | |
Taken from: | |
http://stackoverflow.com/questions/399447/how-to-implement-a-singleton-model/12463209#12463209 |
var DEBUG = true; | |
//var name = "name", type = "type", stage = "stage", caught = "caught"; | |
var grass = "grass", water = "water", fire = "fire", bug = "bug", | |
psychic = "psychic", flying = "flying", ghost = "ghost", fighting = "fighting", | |
normal = "normal", poison = "poison", electric = "electric", ground = "ground", | |
fairy = "fairy", rock = "rock", ice = "ice", dragon = "dragon"; | |
var Pokemon = [ | |
{ name : "MissingNo", type : "blank", stage : 100, caught : 0, species : "Glitch Pokemon"}, |
// Computes the SHA-256 digest of a string with Web Crypto | |
// Source: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest | |
function sha256(str) { | |
// Get the string as arraybuffer. | |
var buffer = new TextEncoder("utf-8").encode(str) | |
return crypto.subtle.digest("SHA-256", buffer).then(function(hash) { | |
return hex(hash) | |
}) | |
} |