Skip to content

Instantly share code, notes, and snippets.

View ecleel's full-sized avatar

Abdulaziz Alshetwi ecleel

View GitHub Profile
@ecleel
ecleel / db_fixtures_dump.rake
Last active January 21, 2024 10:25 — forked from iiska/db_fixtures_dump.rake
Rails 5: Dump Rails db to fixtures
# Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros
#
# Optimized version which uses to_yaml for content creation and checks
# that models are ActiveRecord::Base models before trying to fetch
# them from database.
namespace :db do
namespace :fixtures do
desc 'Dumps all models into fixtures.'
task :dump => :environment do
models = Dir.glob(Rails.root + 'app/models/**.rb').map do |s|
@ecleel
ecleel / dabblet.css
Created April 27, 2013 08:09
Circular Tooltip (SO)
/**
* Circular Tooltip (SO)
* http://stackoverflow.com/q/13132864/1397351
*/
* { margin: 0; padding: 0; }
body {
overflow: hidden;
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg);
}
/* generic styles for button & circular menu */
# encoding: UTF-8
require 'csv'
require 'json'
columns = %w(trackName trackViewUrl artistName version price releaseDate formattedPrice fileSizeBytes description)
exclude = [] # Here you can execlude list of urls you want
data = JSON.load(DATA.read)
puts data.count
@ecleel
ecleel / mdb.rb
Created February 8, 2012 05:05 — forked from dtolj/gist:784634
Ruby MS Access adapter
require 'rubygems'
require 'win32ole'
require 'csv'
mdb_file="c:/Sites/labs/50q.bok"
class AccessDb
attr_accessor :mdb, :connection, :data, :fields, :catalog
def initialize(mdb=nil)