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
puts 'before Thread' | |
ractor = Ractor.new do | |
puts 'Thread start' | |
sleep Ractor.receive | |
puts 'Thread end' | |
end | |
puts 'after Thread' | |
ractor.send 5 |
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
require 'benchmark' | |
ACTORS_COUNT = 8 | |
THREADS_COUNT = 8 | |
def iterative_fib(num) | |
a = 0 | |
b = 1 | |
num.times do | |
temp = a |
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 { TextField, IconButton, CircularProgress } from '@material-ui/core' | |
import { CheckCircle } from '@material-ui/icons' | |
class AutoField extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
saving: false, |
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
trouble: | |
➜ amber w | |
02:25:02 Watch run | (INFO) Building... | |
ld: library not found for -lssl (this usually means you need to install the development package for libssl) | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/forsaken/projects/triathlets/bin/triathlets' -rdynamic -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lyaml -lpcre -lgc -lpthread /usr/local/Cellar/crystal/0.27.0/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/lib -L/usr/local/lib` | |
02:25:06 Watch run | (INFO) Compile time errors detected, exiting... | |
solution: | |
➜ export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig |
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
brew cask install chromedriver | |
gem uninstall chromedriver-helper | |
# add to .bash_profile | |
alias chromedriver="/usr/local/Caskroom/chromedriver/2.41/chromedriver" |
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
aws s3 sync s3://production… /tmp/s3/ --profile production | |
aws s3 sync /tmp/s3/ s3://boss-strapping-stage/ --profile stage --acl public-read |
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
upstream uphill_rating { | |
server 127.0.0.1:4000; | |
} | |
server{ | |
listen 80; | |
server_name uphill.krylov-alexey.ru; | |
location / { | |
try_files $uri @proxy; | |
} |
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
service nginx start | |
thin start -s 2 -C /etc/thin/myapp.yml -R config.ru | |
thin restart -C /etc/thin/myapp.yaml |
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
function SocketIO(url) { | |
this.socket = new WebSocket(url); | |
this.actions = {}; | |
var self = this; | |
this.socket.onmessage = function(event) { | |
var name, message; | |
[name, message] = self.parse_data(event.data); | |
self.actions[name](message) | |
} |
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
alias s="git status" | |
alias a="git add" | |
alias c="git commit -m" | |
alias p="git push origin" | |
alias pu="git pull origin" | |
alias ch="git checkout" | |
alias cb="git checkout -b" | |
alias cl="git clone" | |
alias di="git diff" | |
alias am="git commit --amend" |
NewerOlder