i used a rails console
and a iex -S mix
session
in ruby
json = Model.all.map {|p| {f1: p.f1, ...}}.to_json
File.open('user.json', 'wb+') {|f| f.write(json)}
in elixir
/etc/restartd.conf | |
[10:21] <acidfoo-_> netvirt-agent "netvirt-agent" "sleep 20 && su root -c netvirt-agent &" "" | |
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'byebug' | |
$debug_mode = false #$ true | |
def remove_cassettes(mode, pattern) | |
case mode | |
when 'status_code' | |
grep_match = "code:.#{pattern}" | |
when 'uri_match' |
$!/bin/bash | |
if [ $# -eq 1 -a -d $1 ] | |
then | |
# argument is a folder, lets find the first file | |
first_file=`find $1 -type f | grep -v "$1/\.git/" | head -n 1` | |
if [ "$first_file" = "" ] | |
then | |
echo "directory contains no files, good bye" | |
exit 1 |
module Enumerable | |
# weighted random sampling. | |
# | |
# Pavlos S. Efraimidis, Paul G. Spirakis | |
# Weighted random sampling with a reservoir | |
# Information Processing Letters | |
# Volume 97, Issue 5 (16 March 2006) | |
def wsample(n) | |
self.max_by(n) {|v| rand ** (1.0/yield(v)) } | |
end |
I hereby claim:
To claim this, I am signing this object:
==> Downloading ftp://ftp.kde.org/pub/kde/stable/4.7.4/src/kde-baseapps-4.7.4.tar.bz2 | |
File already downloaded in /Users/mjobin/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/mjobin/Library/Caches/Homebrew/kde-baseapps-4.7.4.tar.bz2 | |
==> cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/kdelibs/4.7.4 -DBUILD_doc=FALSE -DBUNDLE_INSTALL_DIR=/usr/local/Cellar/kde-baseapps/4.7.4/bin | |
cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/kdelibs/4.7.4 -DBUILD_doc=FALSE -DBUNDLE_INSTALL_DIR=/usr/local/Cellar/kde-baseapps/4.7.4/bin | |
-- The C compiler identification is GNU | |
-- The CXX compiler identification is GNU | |
-- Checking whether C compiler has -isysroot | |
-- Checking whether C compiler has -isysroot - yes | |
-- Checking whether C compiler supports OSX deployment target flag |
require 'formula' | |
class KdeBaseapps < Formula | |
url 'ftp://ftp.kde.org/pub/kde/stable/4.7.4/src/kde-baseapps-4.7.4.tar.bz2' | |
homepage 'http://kde.org/' | |
md5 'd44310cad99a9afb757ff13f24eeae32' | |
depends_on 'cmake' => :build | |
depends_on 'automoc4' => :build |
==> cmake . -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/soprano/2.7.3' -DCMAKE_BUILD_TYPE=None -Wno-dev -DSOPRANO_DISABLE_RAPTOR_PARSER=ON -DSOPRANO_DISABLE_RAPTOR_SERIALIZER=ON -DSOPRANO_DISABLE_REDLAND_BACK | |
==> make install | |
[ 0%] [ 1%] [ 1%] [ 2%] [ 3%] [ 3%] [ 4%] Generating asyncquery.moc | |
[ 5%] Generating model.moc | |
Generating pluginmanager.moc | |
Generating filtermodel.moc | |
Generating storagemodel.moc | |
Generating inferencemodel.moc | |
Generating nrlmodel.moc | |
Generating mutexmodel.moc |