Skip to content

Instantly share code, notes, and snippets.

View forsaken1's full-sized avatar
💭
Elixir one love

Alex Krylov forsaken1

💭
Elixir one love
View GitHub Profile
@forsaken1
forsaken1 / async_ractors.rb
Created October 19, 2022 13:56
Async Ractors
puts 'before Thread'
ractor = Ractor.new do
puts 'Thread start'
sleep Ractor.receive
puts 'Thread end'
end
puts 'after Thread'
ractor.send 5
require 'benchmark'
ACTORS_COUNT = 8
THREADS_COUNT = 8
def iterative_fib(num)
a = 0
b = 1
num.times do
temp = a
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,
@forsaken1
forsaken1 / crystal
Created January 24, 2019 04:40
troubles
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
@forsaken1
forsaken1 / solve.sh
Created August 20, 2018 14:27
Chromedriver problem
brew cask install chromedriver
gem uninstall chromedriver-helper
# add to .bash_profile
alias chromedriver="/usr/local/Caskroom/chromedriver/2.41/chromedriver"
aws s3 sync s3://production… /tmp/s3/ --profile production
aws s3 sync /tmp/s3/ s3://boss-strapping-stage/ --profile stage --acl public-read
@forsaken1
forsaken1 / gist:4a1a4d432a2d2ab793bb11a1573ef57e
Created February 21, 2017 18:09
Nginx phoenix config with basic auth
upstream uphill_rating {
server 127.0.0.1:4000;
}
server{
listen 80;
server_name uphill.krylov-alexey.ru;
location / {
try_files $uri @proxy;
}
@forsaken1
forsaken1 / commands
Created September 8, 2016 01:18
Sinatra Thin nginx config
service nginx start
thin start -s 2 -C /etc/thin/myapp.yml -R config.ru
thin restart -C /etc/thin/myapp.yaml
@forsaken1
forsaken1 / SocketIO.js
Created March 17, 2016 11:30
Small wrapper over WebSocket
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)
}
@forsaken1
forsaken1 / aliases.sh
Last active April 4, 2019 16:04
git aliases for *nix
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"