Skip to content

Instantly share code, notes, and snippets.

root@dnsfreebsd:~/npm [master]# node cli.js config set loglevel verbose
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm info config set loglevel verbose
npm ok
root@dnsfreebsd:~/npm [master]# make install
node cli.js install npm
npm info it worked if it ends with ok
npm verb cli [ 'install', 'npm' ]
npm info version 0.1.27-12
(...)
npm info install npm@0.1.27-12
npm ERR! Failed unpacking the tarball.
npm ERR! This is very rare. Perhaps the 'gzip' or 'tar' configs
npm ERR! are set improperly?
npm ERR!
npm ERR! install failed Error: Failed gzip "--decompress" "--stdout" "/home/node/.node_libraries/.npm/.cache/npm/0.1.27-12/package.tgz"
npm ERR! install failed exited with 1
npm ERR! install failed at ChildProcess.<anonymous> (/usr/home/marcin/npm/lib/utils/exec.js:41:19)
npm ERR! install failed at ChildProcess.emit (events:33:26)
/**
* BEM Mixin for Sass (v3.4.0)
*
* Block / Element / Modifier
*
* Example:
*
* @include b(test) {
* background: red;
* @include e(element){
# https://github.com/jgm/pandoc/releases/1.14.0.1
pandoc -V geometry:"top=1.5cm, bottom=1.5cm, left=1.5cm, right=1.5cm" --latex-engine=xelatex *.md -o out.pdf
# http://stackoverflow.com/a/29490456
#!/bin/bash
# Uninstall node.js
#
# Options:
#
# -d Actually delete files, otherwise the script just _prints_ a command to delete.
# -p Installation prefix. Default /usr/local
# -f BOM file. Default /var/db/receipts/org.nodejs.pkg.bom
#! /usr/bin/env ruby
# USAGE:
# sudo port install pwgen
# bundle exec ruby script/dev/bash_friendly_password.rb nil 49
def bash_friendly_password(password=nil, length=128)
password ||= `pwgen -syv #{length} 1`
password.size.times do |i|
password = password.
#! /usr/bin/env ruby
require 'dotenv'
Dotenv.load
require 'redis'
# USAGE:
# Put credentials in .env file, wrapped in single quotes. DO NOT COMMMIT this file to git!
# Wrap values in single quotes and escape all quotes inside strings with \.
# bundle exec ruby script/dev/example_redis-rb.rb
#! /usr/bin/env ruby
require 'dotenv'
Dotenv.load
require 'aws-sdk'
# USAGE:
# Put credentials in .env file, wrapped in single quotes. DO NOT COMMMIT this file to git!
# Wrap values in single quotes and escape all quotes inside strings with \.
# bundle exec ruby script/dev/example_s3.rb
@rubyconvict
rubyconvict / comment.rb
Last active July 26, 2017 05:14
NullObject
class Comment < ActiveRecord::Base
delegate :email, to: author, prefix: true, allow_nil: true
end
@rubyconvict
rubyconvict / bulk_reindexer.rb
Last active February 15, 2023 21:42 — forked from VvanGemert/bulk_reindexer.rb
Asynchronous bulk reindexing module for Searchkick with Sidekiq
# https://medium.com/rubyinside/asynchronous-elasticsearch-bulk-reindexing-with-rails-searchkick-and-sidekiq-26f2f9aa8513
# https://github.com/ankane/searchkick
# 2.3.2 [unreleased]
# - Added wait option to async reindex
# Searchkick.reindex(async: {wait: true})
# This code has been ported to searchkick.
require 'sidekiq/api'
# BulkReindexer
module BulkReindexer