https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/
- rescue/else/ensure in do..end blocks :
# https://bugs.ruby-lang.org/issues/12906
my_func = lamdbda do
begin
import multiprocessing as mp | |
import os | |
import time | |
from dataclasses import dataclass | |
from datetime import datetime | |
@dataclass | |
class JobItem: | |
x: int | |
y: int |
-------- BEGIN argv --------- | |
local foo = ARGV[1] -- foo | |
local bar = ARGV[2] -- foo:bar | |
local baz = ARGV[3] -- foo:baz | |
local val = ARGV[4] | |
local ttl = ARGV[5] | |
-------- END argv --------- | |
local key = "sessions::" .. foo .. "::" .. bar .. "::" .. baz |
N = 8 -- board size | |
function isplaceok(a, n, c) | |
for i = 1, n - 1 do -- for each queen already placed | |
if (a[i] == c) or -- same column? | |
(a[i] - i == c - n) or -- same diagonal? | |
(a[i] + i == c + n) then -- same diagonal? | |
return false -- place can be attacked | |
end | |
end |
https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/
# https://bugs.ruby-lang.org/issues/12906
my_func = lamdbda do
begin
#!/usr/bin/env perl -w | |
use 5.006; | |
use strict; | |
use warnings; | |
use YAML::Tiny; | |
use Cwd qw( cwd ); | |
use File::Spec::Functions qw( catfile catdir ); | |
# This scripts allows to find out which files are excluded in .rubocop.yml |
Let's suppose that we want to keep two different tag versioning on the same repo:
v[0-9]*
for master branch versionsd[0-9]*
for development branch versionsBasic commands: https://git-scm.com/book/en/v2/Git-Basics-Tagging
#!/usr/bin/env perl -w | |
use 5.006; | |
use strict; | |
use warnings; | |
use YAML::Tiny; | |
use Cwd qw( cwd ); | |
use File::Spec::Functions qw( catfile catdir ); | |
my $yaml = YAML::Tiny->read( |
#!/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
PROJECT_DIR=$(git rev-parse --show-toplevel) | |
# Base branch for rebasing | |
BASE_BRANCH="master" | |
# Enter here the name of the branches to rebase |
While developing a serialization gem I needed to compare my current code with previous gem versions.
(Un)fortunately bundler
does not allow to install several versions of the same gem to prevent conflicts on class names.
The purpose of this script is to wrap a gem into a namespace/module named.
You should set in the main script:
I hereby claim:
To claim this, I am signing this object: