Skip to content

Instantly share code, notes, and snippets.

View divoxx's full-sized avatar

Rodrigo Kochenburger divoxx

  • Doximity
  • San Francisco, CA
View GitHub Profile
@divoxx
divoxx / is_writeable.sh
Last active November 26, 2018 21:51
Bash function to tell if a path is writeable by current user
_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 April 4, 2018 21:42
electron build failure
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 ]
* Determining the location of the kernel source code
$ 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
* 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 ...
$ 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
class Foo
@@mutex = Mutex.new
def self.something
@@mutex.synchronize do
return @something if defined?(@something)
@something = init_here
end
end
end
$ brew install libiconv
$ bundle config build.nokogiri -- --with-iconv-dir=/usr/local/opt/libiconv
$ bundle install
$ 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/
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
class Bar
def self.bar
@bar ||= "bar"
end
def self.baz
@@baz ||= "baz"
end
def bar