Skip to content

Instantly share code, notes, and snippets.

Avatar

Rodrigo Kochenburger divoxx

  • Doximity
  • San Francisco, CA
View GitHub Profile
@divoxx
divoxx / is_writeable.sh
Last active Nov 26, 2018
Bash function to tell if a path is writeable by current user
View is_writeable.sh
_is_writeable() {
if [[ "$(uname)" == "Darwin" ]]; then
mapfile -d $' ' -t stat < <(stat -L -f '%p %g %u' "${1}")
else
mapfile -d $' ' -t stat < <(stat -L -c '%a %g %u' "${1}")
fi
declare -i prm=${stat[0]}
declare -i grp=${stat[1]}
declare -i own=${stat[2]}
@divoxx
divoxx / build.log
Last active Apr 4, 2018
electron build failure
View build.log
This file has been truncated, but you can view the full file.
* Package: dev-util/electron-1.7.13
* Repository: atom
* Maintainer: elvis@magic.io proxy-maint@gentoo.org
* USE: abi_x86_64 amd64 elibc_glibc gnome-keyring gtk3 kernel_linux l10n_am l10n_ar l10n_bg l10n_bn l10n_ca l10n_cs l10n_da l10n_de l10n_el l10n_en-GB l10n_es l10n_es-419 l10n_et l10n_fa l10n_fi l10n_fil l10n_fr l10n_gu l10n_he l10n_hi l10n_hr l10n_hu l10n_id l10n_it l10n_ja l10n_kn l10n_ko l10n_lt l10n_lv l10n_ml l10n_mr l10n_ms l10n_nb l10n_nl l10n_pl l10n_pt-BR l10n_pt-PT l10n_ro l10n_ru l10n_sk l10n_sl l10n_sr l10n_sv l10n_sw l10n_ta l10n_te l10n_th l10n_tr l10n_uk l10n_vi l10n_zh-CN l10n_zh-TW proprietary-codecs pulseaudio system-ffmpeg tcmalloc userland_GNU
* FEATURES: preserve-libs sandbox userpriv usersandbox
* Checking for at least 3 GiB RAM ...
[ ok ]
* Checking for at least 5 GiB disk space at "/var/tmp/portage/dev-util/electron-1.7.13/temp" ...
[ ok ]
View emerge-adobe-flash.log
$ sudo emerge -va adobe-flash
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild U ] www-plugins/adobe-flash-27.0.0.183:22::gentoo [27.0.0.130-r1:22::gentoo] USE="nsplugin ppapi" ABI_X86="64 -32 (-x32)" 18,056 KiB
Total: 1 package (1 upgrade), Size of downloads: 18,056 KiB
Would you like to merge these packages? [Yes/No] yes
View build.log
* Package: dev-qt/qtcore-5.5.1-r1
* Repository: local
* USE: abi_x86_64 amd64 elibc_glibc icu kernel_linux userland_GNU
* FEATURES: preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking qtbase-opensource-src-5.5.1.tar.xz to /var/tmp/portage/dev-qt/qtcore-5.5.1-r1/work
>>> Source unpacked in /var/tmp/portage/dev-qt/qtcore-5.5.1-r1/work
>>> Preparing source in /var/tmp/portage/dev-qt/qtcore-5.5.1-r1/work/qtbase-opensource-src-5.5.1 ...
* Applying qtcore-5.5.1-qatomic_ia64.h.patch ... [ ok ]
* Applying qtcore-5.5.1-libsystemd.patch ...
View console.log
$ ls -ld ~/Gentoo/tmp/lib/libz.so.1.2.6
-rwxr-xr-x 1 divoxx staff 88380 Mar 28 11:41 Gentoo/tmp/lib/libz.so.1.2.6
View example.rb
class Foo
@@mutex = Mutex.new
def self.something
@@mutex.synchronize do
return @something if defined?(@something)
@something = init_here
end
end
end
View gist:6ca364e188dd619d516b
$ brew install libiconv
$ bundle config build.nokogiri -- --with-iconv-dir=/usr/local/opt/libiconv
$ bundle install
View gist:a54b595ce67e7eb23978
$ ls -ld $(pwd)/data
drwxr-xr-x 3 divoxx staff 102 Jun 12 14:29 /Users/divoxx/Code/src/github.com/doximity/reproducible-envs/data
$ ls -la $(pwd)/data/
total 0
drwxr-xr-x 3 divoxx staff 102 Jun 12 14:29 .
drwxr-xr-x 9 divoxx staff 306 Jun 12 14:45 ..
drwxr-xr-x 3 divoxx staff 102 Jun 12 14:29 es
$ docker run -i -t -v $(pwd)/data:/data doximity/base-arch ls -la /data/
View gist:10061747
class ApplicationController < ActionController::Base
around_filter :set_timezone
def set_timezone
old, Time.zone = Time.zone, current_user.time_zone
yield
ensure
Time.zone = old
end
end
View gist:9770489
class Bar
def self.bar
@bar ||= "bar"
end
def self.baz
@@baz ||= "baz"
end
def bar