Skip to content

Instantly share code, notes, and snippets.

View neovintage's full-sized avatar
😅
data is always moving

Rimas Silkaitis neovintage

😅
data is always moving
View GitHub Profile
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@neovintage
neovintage / postgres_table_size.sql
Created August 13, 2015 21:03
Get Size of Postgres Tables
SELECT relname as "Table",
pg_size_pretty(pg_total_relation_size(relid)) As "Size",
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size"
FROM pg_catalog.pg_statio_user_tables
ORDER BY pg_total_relation_size(relid) DESC;
@neovintage
neovintage / gist:62820
Created February 12, 2009 19:07
Initial thoughts on a datamapper data warehouse gem
class DailySales
include DMDataWarehouse::Fact
dimension date
dimension product
dimension customer
property :quantity_sold, Integer
property :unit_amount, Float
property :sales_total, Float
#!/bin/bash
echo "SliceHost Automated Setup for Ubuntu 9.10"
echo "Start from a fresh Ubuntu Slice Rebuild"
echo "Installing Nginx, PHP, php-fpm, MySQL & Wordpress"
INTERACTIVE_SETUP=1
ROOT_PASS="root123"
USER_NAME="webadmin"
@neovintage
neovintage / mongo_fifo_store.rb
Created November 6, 2010 21:01
A cache store for MongoDB that uses capped collections
require 'mongo'
require 'rails'
module Rails
class << self
def fifo_cache
FIFO_CACHE
end
end
end
@neovintage
neovintage / gist:1016960
Created June 9, 2011 15:20 — forked from dhh/gist:1014971
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
first_vehicle:
price: 1234.93
options: |
<%= [ StickerOption.new("floor mats"), StickerOption.new("Wipers") ].to_yaml.gsub(/\n/,"\n ") %>
@neovintage
neovintage / gist:1439087
Created December 6, 2011 17:35
classifier_libsvm_minimal_modular with some extra comments
require 'modshogun'
require 'narray'
# For the purposes of the example this is a helper file that's bundled in
# the examples directory. It does some things like loading data and
# checking some of the math. It's not necessary to include in your own
# projects
require 'load'
# Here we're setting our parameters for the SVM
@neovintage
neovintage / asset.rb
Created December 7, 2011 21:19
plupload - mongodb - carrierwave
class Asset
include Mongoid::Document
include Mongoid::Timestamps
field :name
field :type
field :extension
field :uploaded_by
mount_uploader :file, AssetUploader
@neovintage
neovintage / index.html
Created December 7, 2011 21:40
jquery stuff
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>