Skip to content

Instantly share code, notes, and snippets.


Igor Escobar igorescobar

View GitHub Profile
igorescobar / getJpegQuality.js
Created May 15, 2020 — forked from FranckFreiburger/getJpegQuality.js
pure JavaScript jpeg quality value recover
View getJpegQuality.js
// javascript jpeg decoder:
// Determine the JPEG compression quality from the quantization tables:
// JPEG File Layout and Format:
// jpeg constants:
function getQuantizationTables(data) {
var quantizationTables = []
var dctZigZag = new Int32Array([
View callback_disabler.rb
# In spec/support/callback_disabler.rb
module CallbackDisabler
def self.store_callbacks(model, filters)
model = constantize(model)
filters.each do |filter|
model.send("_#{filter}_callbacks").each do |callback|
stored_callbacks[model] << {
filter: filter, kind: callback.kind, raw_filter: callback.raw_filter
igorescobar / utf8encode.rake
Created Oct 9, 2012 — forked from francesc/utf8encode.rake
Manage the UTF-8 encoding header for ruby 1.9
View utf8encode.rake
desc "Manage the encoding header of Ruby files"
task :utf8_encode_headers => :environment do
files =
["*.rb", "*.rake"].each do |extension|
files.concat(Dir[ File.join(Dir.getwd.split(/\\/), "**", extension) ])
files.each do |file|
content =
next if content[0..16] == "# coding: UTF-8\n\n" ||