Skip to content

Instantly share code, notes, and snippets.

View artm's full-sized avatar

Artem Baguinski artm

  • Performation B.V.
  • Emmen, NL
  • 18:39 (UTC +02:00)
View GitHub Profile
@artm
artm / README.md
Last active December 19, 2022 19:08 — forked from michaelneu/README.md
A basic, but fast git prompt.

bash-basic-git-prompt

This is a considerably faster, but much more basic alternative to bash-git-prompt.

Thanks to @michaelneu for inspiration. I modified the script to make it even faster on windows, where subshells are too slow. I also inserted a new line into the prompt as personal preference.

screenshot

@artm
artm / Gemfile
Last active May 23, 2018 10:09
demonstration of pry-rescue problem
gem "pry-rescue"
@artm
artm / db.mancave.zzz
Created April 7, 2017 08:07
local dns setup
; /etc/bind/db.mancave.zzz
$TTL 604800
@ IN SOA mancave.zzz. admin.mancave.zzz. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.mancave.zzz.
$ rake db:migrate
== 20141127094407 AddHospitalsUsers: migrating ================================
-- create_table(:hospitals_users)
-> 0.0877s
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Validatie mislukt: Email is al in gebruik/home/artm/src/dpi/GN_Guide/vendor/bundle/gems/activerecord-4.1.4/lib/active_record/validations.rb:57:in `save!'
artm@parurak:~/src/artm/so/test/foo
$ ls | sort
a
b
c
d
e
F
artm@parurak:~/src/artm/so/test/foo
artm@parurak:~/src/dpi/dashboards/kraamzorgcompleet
$ grep -R "_chain_ =" bower_components/dash.js/src | sed -r 's/.*: //;s/\._chain_ = /({...}) -> /;s/"(.*)";/\1/;s/terminate/-/' | column -t
Plain.with({...}) -> Plain
Plain.split({...}) -> Split
Plain.filter({...}) -> Plain
Plain.extract({...}) -> Plain
Plain.size({...}) -> -
SubSplit.sum({...}) -> LabeledNumbers2D
SubSplit.highcharts({...}) -> -
LabeledNumbers2D.mul({...}) -> LabeledNumbers2D
[ey-local] A box named ey-gentoo-rack already exists.
[ey-local] Using /home/artm/src/dpi/reflex2 as the application directory.
[ey-local] VM already created. Booting if it's not already running...
[ey-local] Creating instance DNA ...
[ey-local] Initiating Chef run ...
[default] [Fri, 09 Aug 2013 09:36:45 +0000] INFO: Starting Chef Solo Run
[default] [Fri, 09 Aug 2013 09:36:45 +0000] INFO: Mounting devices for kernel 2.6.32-amazon-xen-r3
[default] [Fri, 09 Aug 2013 09:36:45 +0000] INFO: 2.6.32+ kernel detected, assuming paravirtual mount style
[default] [Fri, 09 Aug 2013 09:36:45 +0000] INFO: {"SHELL"=>"/bin/bash",
"TERM"=>"vt100",
@artm
artm / README.md
Last active December 18, 2015 13:09
GenePoker
@artm
artm / something.rb
Last active December 15, 2015 01:29
DRYer specs
module Something
def self.foo a, *args
a.zip(*args).flatten.select{|e|e}
end
end
# I have something like:
def map_stream source, destination, options_and_mapping
option1 = options_and_mapping.delete :option1
quiet = options_and_mapping.delete :quiet
source.each do |input_record|
output_record = map_record input_record, options_and_mapping
some_extra_operation(output_record,option1) if option1
@logger.info("mapped record #{input_record} to #{output_record}") unless quiet
destination.insert output_record