Skip to content

Instantly share code, notes, and snippets.

View vortizhe's full-sized avatar

Victor Ortiz vortizhe

View GitHub Profile
@vortizhe
vortizhe / switcher.html
Last active January 7, 2018 10:43
Checkbox with switch style full css animation
<div class="switcher">
<input type="checkbox", name="wadus" id="wadus">
<label for="wadus" class="switch"></label>
</div>
@vortizhe
vortizhe / cloudSettings
Last active March 20, 2018 08:38
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-03-20T08:38:38.203Z","extensionVersion":"v2.9.0"}
@vortizhe
vortizhe / gist:77ac712a4d1baecdd0def29cd348c7dc
Created September 20, 2017 10:07
Sass mixing for IE10-11
@mixin ie() {
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
@content;
}
}
@vortizhe
vortizhe / cloudSettings
Last active July 2, 2017 20:35
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-07-02T20:35:17.760Z","extensionVersion":"v2.8.2"}
@vortizhe
vortizhe / config.rb
Last active October 26, 2017 13:40
Middleman inline svg helper
helpers do
def inline_svg name
root = Middleman::Application.root
file_path = "#{root}/source/assets/images/svg/#{name}.svg"
if File.exists?(file_path)
File.read(file_path)
else
"<span class='icon-error'>Icon #{name} not found</span>"
end
end
Test JS JS Gzip CSS CSS Gzip Precompilado
Situación inicial 20.624 7.248 3.064 720 287,63s
Sin compresión 20.920 7.656 4.824 816 21,59s
Optimización y ckeditor desde cdn 3.872 1.248 1.640 368 156,32s
Reemplazar sass con libsass 3.872 1.248 1.640 368 137,66s
Reemplazar uglifier con uglifyjs de node 3.872 1.248 1.640 368 19,63s
Test JS Kb JS Gzip CSS Kb CSS Gzip Precompilado
Situación inicial 20.624 7.248 3.064 720 287,63s
Sin compresión 20.920 7.656 4.824 816 21,59s
Optimización y ckeditor desde cdn 3.872 1.248 1.640 368 156,32s
@vortizhe
vortizhe / gist:b512fa7baf4eab4186ef
Created March 9, 2016 16:44
Replace asset pipeline ruby uglifyjs with node version
require 'open3'
class NodeUglify
def compress(input)
output = ''
Open3.popen3('uglifyjs') do |i, o, t|
i.puts input
i.close
while line = o.gets
output += line
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
"sort-order-fallback": "abc",
root = "/fullpath/your_project/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.error.log"
stdout_path "#{root}/log/unicorn.log"
listen 8080
worker_processes 2
timeout 30