Skip to content

Instantly share code, notes, and snippets.

@eliasmacedo
eliasmacedo / highcharts_customization.html
Last active August 2, 2017 21:46
stackLabels and tooltip formatting with custom data on series: http://jsfiddle.net/Lfuop0pu/1/
<div id="container" style="height: 400px"></div>
<script src="https://code.highcharts.com/highcharts.js"></script>
@eliasmacedo
eliasmacedo / jquery_visibility.js
Created March 8, 2017 15:27
jQuery Visibility Plugin
jQuery.fn.visible = function() {
return this.css('visibility', 'visible');
};
jQuery.fn.invisible = function() {
return this.css('visibility', 'hidden');
};
jQuery.fn.visibilityToggle = function() {
return this.css('visibility', function(i, visibility) {
@eliasmacedo
eliasmacedo / prototypal_inheritance.js
Last active March 6, 2017 15:36
Prototypal Inheritance example with Object.create Polyfill
var person = {
firstname: 'Default',
lastname: 'Default',
greet: function(){
return 'Hi ' + this.firstname;
}
};
var j_doe = Object.create(person);
//this creates an object with the properties present in the 'person' object
@eliasmacedo
eliasmacedo / s3_image_resizer.rb
Created February 21, 2017 19:17
Resize and upload a collection of images to s3 (carrierwave's recreate_versions! alternative)
class S3ImageResizer
def initialize(collection)
@width = 470
@height = 470
@collection = collection
@bucket = get_bucket
end
def start
@eliasmacedo
eliasmacedo / qrcode_s3_snippet.rb
Last active February 21, 2017 18:46
Sending QRcode to S3 without having to save it first
#Gemfile##############
gem 'rqrcode' # QRCode
gem 's3' #AWS s3
######################
#application.yml######
AWS_ACCESS_KEY_ID: 'xxx'
AWS_SECRET_ACCESS_KEY: 'YYY'
AWS_BUCKET_NAME: 'zzz'
######################
# Replace RubyMine2016.1 with the version you have installed
# You will lose all configuration options, such as line number display and other style preferences
rm -rf ~/.java/.userPrefs/jetbrains/rubymine/
rm -rf ~/.RubyMine2016.1/