User.first.name # => "Renan"
User.first.name # => OpenSSL::Cipher::CipherError: bad decrypt
require "rubocop" | |
module RuboCop | |
module Cop | |
module Lint | |
# This cop checks bad use of the Minitest `assert` method | |
# | |
# `assert` method's second argument is the error message when the | |
# first argument evals to false. | |
# |
#!/bin/bash | |
# Pushes the current branch to origin and opens a tiny tmux split to track | |
# the CI status. Upon completion, speaks the status aloud using `say`. | |
set -e | |
if [ "$1" != "--wait" ]; then | |
git push -u origin HEAD | |
tmux split-window -dv -l 2 "'$0' --wait" | |
else | |
ref="$(git rev-parse -q HEAD)" |
# Updated for Ruby 2.3 | |
string_t = None | |
def get_rstring(addr): | |
s = addr.cast(string_t.pointer()) | |
if s['basic']['flags'] & (1 << 13): | |
return s['as']['heap']['ptr'].string() | |
else: | |
return s['as']['ary'].string() |
apt update | |
apt upgrade | |
apt install build-essential | |
apt install pkg-config | |
apt install libnet-dev python-yaml libaio-dev | |
apt install libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libcap-dev python-future | |
# criu install | |
curl -O -sSL http://download.openvz.org/criu/criu-3.10.tar.bz2 | |
tar xjf criu-3.10.tar.bz2 |
class Node | |
attr_accessor :edges, :jobs, :id | |
def initialize(id, arrivals_per_tick) | |
@id = id | |
@jobs = 0.0 | |
@tick = 0 | |
@edges = [] | |
@arrivals_per_tick = arrivals_per_tick | |
end |