# cat /etc/security/limits.conf
* hard nofile 500000
* soft nofile 500000
root hard nofile 500000
root soft nofile 500000
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 supertagged._ | |
/*** ONE TIME PREDEF **/ | |
trait Opp { | |
type Operation | |
type Divide <: Operation | |
type Multiply <: Operation | |
} |
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 dump() { | |
time=$(date '+%H_%M_%S'); | |
date=$(date '+%Y_%m_%d'); | |
database=$1; | |
dumps_dir="$HOME/dumps"; | |
mkdir -p "$dumps_dir/$date"; | |
dumpfile=$dumps_dir/$date/$time"_"$database"_dump".psql.gz | |
pg_dump $database -W -U ontheway --no-privileges --clean --exclude-table=schema_migrations | gzip > $dumpfile; |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
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
package net.nelanka.akka_sandbox.cluster_sharding.experiments | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
import scala.language.postfixOps | |
import scala.util.{Failure, Success} | |
import akka.actor.{Actor, ActorRef, ActorSystem, FSM, Props, Terminated} | |
import akka.cluster.Cluster | |
import akka.cluster.sharding.ShardCoordinator.LeastShardAllocationStrategy |
Задание
Реализовать на Ruby с использованием Rails приложение со следующим функционалом:
- Регистрация / авторизация пользователей.
- Создание портфеля акций (5-6 акций достаточно) для пользователя: стандартный CRUD.
- Данные должны скачиваться с Yahoo Finance.
- Сделать вывод графика "стоимость портфеля от времени" за 2 последних года по выбранным в п.2 акциям.
Требования
This is how I debug SystemStackError when there is no stack trace.
My first attempt was:
begin
a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
puts caller
end
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
class FoosController < ApplicationController | |
respond_to :atom, :api_v1 | |
before_filter :set_default_format | |
def index | |
@foos = Foo.all | |
respond_to do |format| | |
format.xml { render :xml => @foos.to_xml } | |
format.api_v1 { render :json => @foos.to_json } |
NewerOlder