Skip to content

Instantly share code, notes, and snippets.

Avatar

Dumitru Ursu dimaursu

View GitHub Profile
View sample grid
<section>
<div class="row">
<div class="two columns">
<div class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis bibendum nisl urna, vitae laoreet libero sagittis in. Fusce accumsan est tellus. Curabitur quis lorem pretium, ultricies odio vitae, aliquet justo. Integer est dolor, volutpat ut eros in, tincidunt pharetra metus. Vivamus finibus quis nunc sit amet venenatis. Donec aliquam ante ac placerat sollicitudin. Proin eget nulla quis risus cursus rhoncus sit amet id lorem. Morbi malesuada, lacus ut feugiat interdum, augue lectus euismod tortor, eu aliquam orci ipsum eu lectus. Praesent orci erat, tincidunt vitae varius cursus, accumsan a diam.
</div>
</div>
<div class="two columns">
<div class="text">
Vivamus venenatis, leo posuere mollis vulputate, velit dui fermentum metus, sed interdum sapien orci nec diam. Aenean maximus nisl non ipsum mattis, ac imperdiet nulla egestas. Aliquam dictum laoreet eros in laoreet. Duis auctor auctor turpis, quis al
@dimaursu
dimaursu / index_shortener.rb
Created Jan 13, 2015
Fix indexes for MySQL with utf8mb4 encoding
View index_shortener.rb
def character_columns
# build a hash with all the columns that contain characters
@character_columns ||= tables.map {|table|
col = columns(table)
.select {|column| column.type == :string || column.type == :text }
.map {|column| { name: column.name, type: column.sql_type} }
next if col.empty?
[table, col]
}.compact.to_h
end
View migrations.rb
remove_index aspect_visibilities, shareable_and_aspect_id
add_index aspect_visibilities, ["shareable_id", "shareable_type", "aspect_id"], name: shareable_and_aspect_id, length: {"shareable_type"=>189}, using: :btree
remove_index aspect_visibilities, index_aspect_visibilities_on_shareable_id_and_shareable_type
add_index aspect_visibilities, ["shareable_id", "shareable_type"], name: index_aspect_visibilities_on_shareable_id_and_shareable_type, length: {"shareable_type"=>190}, using: :btree
remove_index chat_contacts, index_chat_contacts_on_user_id_and_jid
add_index chat_contacts, ["user_id", "jid"], name: index_chat_contacts_on_user_id_and_jid, length: {"jid"=>190}, using: :btree
remove_index comments, index_comments_on_guid
View 20150106050733_set_mysql_to_unicode_mb4.rb
class SetMysqlToUnicodeMb4 < ActiveRecord::Migration
# Converts the tables and strings columns to utf8mb4, which is the true, full
# unicode support in MySQl
UTF8_PAIRS = Hash.new { |h,k| h[k] = [] }
tables = ActiveRecord::Base.connection.tables
tables.each do |table|
ActiveRecord::Base.connection.columns(table).each do |column|
# build a hash with all the columns that contain characters
if (column.type == :string) || (column.type == :text)
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-pages/core-pages.html">
@dimaursu
dimaursu / web_dev.gpl
Last active Mar 14, 2020
50 web design color palettes in GPL format
View web_dev.gpl
GIMP Palette
Name: Web design
#
105 210 231 Giant Goldfish
167 219 219
224 228 204
243 134 48
250 105 0
255 255 255 separator
233 76 111 Cardsox
You can’t perform that action at this time.