Skip to content

Instantly share code, notes, and snippets.

View rapito's full-sized avatar
🎯
Focusing

Robert Peralta rapito

🎯
Focusing
View GitHub Profile
@rapito
rapito / quick_test.rb
Created February 22, 2026 21:15
Rails Test with TimescaleDB attempting to run schema:load twice with nested caggs.
# frozen_string_literal: true
# - Run your timescale db
# - Update DB_URI variable down below
# - Run the following:
# ```
# ruby quick_test.rb
# ```
# - it should fail with:
# ActiveRecord::StatementInvalid: PG::DependentObjectsStillExist: ERROR: cannot drop view events_per_minute because other objects depend on it
@rapito
rapito / SassMeister-input.scss
Last active June 1, 2017 14:32
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$values: 5 10 15 25 50;
$size-names: 'sm' 'df' 'md' 'lg' 'xlg';
$side-names: 'left' 'top' 'right' 'bottom';
@rapito
rapito / example.js
Created March 18, 2016 04:33
File upload with restivus.
// Example from @cuatromedios on https://github.com/kahmali/meteor-restivus/issues/25#issuecomment-127065719
Api.addRoute('questions/:question/photo', {authRequired: true}, {
post: function () {
var uploadedFile = new FS.File(this.request.files.photo.path);
var insertedFile = Photos.insert(uploadedFile, function (err, fileObj) {
if (err) {
console.log(err);
} else {
console.log(fileObj.size()+" "+fileObj.name()+" "+fileObj.extension());
}
@rapito
rapito / ubuntu-dev-bootstrap.sh
Last active November 28, 2015 06:21
Provision script to download usefull development tools for a new installation of ubuntu.
#bin/sh
# update apt-get
sudo apt-get update
# Curl
sudo apt-get -y install curl
# virtualbox
# sudo apt-get -y install virtualbox-guest-utils
@rapito
rapito / Gruntfile.js
Created September 3, 2015 22:33
grunt-js2coffee configuration for Meteor project.
// This is a configuration file to help you convert all your meteor .js files to .coffee
// Follow this steps:
// 1 - Create a '{PROJECT_ROOT}/private/js2coffee/' folder on your meteor project root.
// 2 - Create a 'package.json' file into '/private/js2coffee/' folder. (grab package.json example on http://gruntjs.com/getting-started)
// 3 - Copy this 'Gruntfile.js' to '/private/js2coffee/'
// 4 - cd into '{PROJECT_ROOT}/private/js2coffee/' and 'npm install grunt-js2coffee --save-dev' on the terminal
// 5 - 'grunt' on the terminal
// 6 - cd into '{PROJECT_ROOT}/private/coffee/'
// 7 - 'cp -r ./ ../../' on the terminal
// 8 - Manually delete all js files that were converted.