Skip to content

Instantly share code, notes, and snippets.

Rodrigo Panachi rpanachi

Block or report user

Report or block rpanachi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rpanachi
rpanachi / how-to-fix-macos-mojave-battery-draining-issue.md
Last active Jan 13, 2019
How to Fix macOS Mojave Battery Draining Issue
View how-to-fix-macos-mojave-battery-draining-issue.md
View char.scad
latest version now at: http://github.com/tbuser/openscad-bitmap
module make_atari_bitmap(char, block_size, height, include_base) {
if (char == "0") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,1,1,1,0,
0,1,1,1,1,1,1,0,
@rpanachi
rpanachi / README.md
Last active Apr 18, 2019 — forked from brennanneoh/README.md
Anet A8 Printer Profile for Cura 3D
View README.md

Setup

  1. Install Cura 2.4
  2. Copy anet_a8.def.json to ~/Library/Application Support/cura/3.4/definitions
  3. Open Cura
  4. Expand Custom, then select Anet A8
  5. Click Finish
@rpanachi
rpanachi / db.rake
Created Apr 10, 2016
Rakefile for Sequel database operations
View db.rake
namespace :db do
require 'sequel'
Sequel.extension(:migration)
MIGRATIONS_PATH = 'db/migrations'
def db_conn_env
ENV["BOOKSHELF_DATABASE_URL"]
end
View tsocks.conf
# This is the configuration for libtsocks (transparent socks)
# Lines beginning with # and blank lines are ignored
#
# The basic idea is to specify:
# - Local subnets - Networks that can be accessed directly without
# assistance from a socks server
# - Paths - Paths are basically lists of networks and a socks server
# which can be used to reach these networks
# - Default server - A socks server which should be used to access
# networks for which no path is available
View skip_validation.rb
# source: http://gistflow.com/posts/749-canceling-validations-in-activerecord
# declaration
def skipping_validation(methods, &block)
skipped_validations = methods.map do |method, kinds|
Array(kinds).map do |kind|
_validators[method].select { |v| v.kind == kind }.map do |validation|
_validate_callbacks.select { |c| c.filter == validation }.map do |callback|
_validate_callbacks.delete(callback)
end
@rpanachi
rpanachi / require_profiler.rb
Last active Aug 29, 2015
Require profiler
View require_profiler.rb
#!/usr/bin/env ruby
#usage: ruby require_profiler.rb ./config/application
ENV['NO_RELOAD'] ||= '1'
ENV['RAILS_ENV'] ||= 'development'
ENV['RACK_ENV'] ||= 'development'
require 'rubygems'
require 'benchmark'
View benchmark.rb
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
View resque-stats.sh
#!/bin/sh
for q in $(echo 'SMEMBERS "resque:queues"' | redis-cli | awk '{print $1}')
do
echo $q $(echo "LLEN \"resque:queue:$q\"" | redis-cli)
done
# in a single line;
# for q in $(echo "SMEMBERS \"resque:queues\"" | redis-cli | awk '{print $1}'); do echo $(echo "LLEN \"resque:queue:$q\"" | redis-cli); done | awk '{s+=$1} END {print s}'
@rpanachi
rpanachi / deploy.sh
Created Sep 20, 2012
Forrest Deployer Shell
View deploy.sh
#!/bin/bash
APP_DIR=/var/local/apps/app
RAILS_ENV=production
function step
{
if [ "$step_count" = "" ]; then
step_count=0
fi
You can’t perform that action at this time.