Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
require "active_record" | |
require "disco" | |
require "elasticsearch" | |
require "searchkick" | |
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" | |
ActiveRecord::Schema.verbose = false | |
ActiveRecord::Schema.define do | |
create_table :movies do |t| | |
t.string :name |
# Export data from Microsoft Access .mdb database into .csv files | |
# using https://github.com/brianb/mdbtools | |
# Install with homebrew - "brew install mdbtools" | |
class ConverterScript | |
tables = `mdb-tables -d , your_db_name.mdb`.chop.split(",") | |
tables.each do |table| | |
exists = system("mdb-export your_db_name.mdb '#{table}'") | |
`mdb-export your_db_name.mdb '#{table}' > #{table.gsub(" ", "_")}.csv` if exists |
def paginate(scope, default_per_page = 20) | |
collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i) | |
current, total, per_page = collection.current_page, collection.num_pages, collection.limit_value | |
return [{ | |
pagination: { | |
current: current, | |
previous: (current > 1 ? (current - 1) : nil), | |
next: (current == total ? nil : (current + 1)), |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
For use on:
https://console.aws.amazon.com/s3/home
Only tested in Chrome.
Installation instructions:
## Get FFMpeg working on heroku by building binaries using vulcan | |
gem install vulcan | |
vulcan create foo | |
git clone --depth 1 git://source.ffmpeg.org/ffmpeg | |
cd ffmpeg |