$> sudo pacman -S gcc5 openssl-1.0
$> CC=gcc-5 CXX=g++-5 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig/:/usr/lib/pkgconfig/RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr
/lib/openssl-1.0/ asdf install ruby 2.3.1
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
def bar | |
:bar | |
end | |
def foo(a, b=bar) | |
puts [a, b].inspect | |
end | |
foo("hi") | |
# => ["hi", :bar] |
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
# spec/support/authenticated.rb | |
class Authenticated < Module | |
def initialize(current_user:) | |
super() do | |
define_method :current_user do | |
current_user | |
end | |
end | |
end | |
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
[CLI] I | 2018-06-29T15:49:44-07:00 | Using config from 'omnibus.rb' | |
[Software: config_guess] W | 2018-06-29T15:49:44-07:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be a | |
vailable for this version. | |
Building aptible-toolbelt ... | |
[Software: preparation] I | 2018-06-29T15:49:44-07:00 | Resolving manifest entry for preparation | |
[NullFetcher: preparation] I | 2018-06-29T15:49:44-07:00 | Fetching `preparation' (nothing to fetch) | |
[Software: config_guess] I | 2018-06-29T15:49:44-07:00 | Resolving manifest entry for config_guess | |
[Software: config_guess] W | 2018-06-29T15:49:44-07:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be a | |
vailable for this version. | |
[Software: config_guess] W | 2018-06-29T15:49:44-07:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be 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
require "selenium/webdriver" | |
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, browser: :chrome) | |
end | |
Capybara.register_driver :headless_chrome do |app| | |
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |
chromeOptions: { args: %w(headless disable-gpu) } | |
) |
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
# content has to be in .config/fish/config.fish | |
# if it does not exist, create the file | |
setenv SSH_ENV $HOME/.ssh/environment | |
function start_agent | |
echo "Initializing new SSH agent ..." | |
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV | |
echo "succeeded" | |
chmod 600 $SSH_ENV | |
. $SSH_ENV > /dev/null |
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
FROM ubuntu:16.04 | |
LABEL maintainer="Haris Amin <[email protected]>" | |
LABEL Description="Docker Container for the Apple's Swift programming language" | |
# Yoinked from | |
# https://github.com/swiftdocker/docker-swift/blob/5c83628d4696bca62aec3136a4ee9b854e8d548e/4.0/Dockerfile | |
# Install related packages and set LLVM 3.8 as the compiler | |
RUN apt-get -q update && \ | |
apt-get -q install -y \ |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
From http://unix.stackexchange.com/a/194790/159078
I doubt it will make a difference but, just in case, here's how to do the same thing in Perl:
perl -ne 'print if ++$k{$_}==1' out.txt
If the problem is keeping the unique lines in memory, that will have the same issue as the awk
you tried. So, another approach could be:
cat -n out.txt | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2-
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
defmodule Foo do | |
defmacro foo_macro(i) do | |
quote do | |
unquote(i) | |
end | |
end | |
def bar(foo_macro(1) = i), do: IO.puts(i) | |
def bar(foo_macro(2) = i) do | |
IO.puts "This better be 2: #{i}" |