Skip to content

Instantly share code, notes, and snippets.

Aldrien aldrienht

Block or report user

Report or block aldrienht

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aldrienht
aldrienht / testing_wicked_pdf_with_cucumber
Created Oct 4, 2017
Testing With Cucumber and Wicked PDF
View testing_wicked_pdf_with_cucumber
#Step-Definition
require 'tempfile'
Then(/^I follow the PDF link "([^"]*)"$/) do |text|
find("a[title='#{text}']").click
temp_pdf = Tempfile.new('pdf')
if Capybara.current_driver == Capybara.javascript_driver
temp_pdf << page.driver.source.force_encoding('UTF-8')
else
temp_pdf << page.driver.response.body.force_encoding('UTF-8')
@aldrienht
aldrienht / gist:f31967e6eba4088324088df55e03a271
Created Dec 7, 2016
Simple Dynamin Morris Bar Chart - Rails
View gist:f31967e6eba4088324088df55e03a271
// JS Code
// Assumed that you already declared libraries needed.
$.ajax({
type: "GET",
dataType: 'json',
url: "/en/project_chart", // This is the URL to the API
})
.done(function( data ) {
if ((typeof data === "undefined" || data === null) || data.length === 0) {
@aldrienht
aldrienht / gist:cdedca54a9398bdc6f7a3e12d7a222db
Last active Aug 5, 2016
Matching System Font with your local environment and Amazon Linux
View gist:cdedca54a9398bdc6f7a3e12d7a222db
Step 1: Back up your EC2 System fonts.
cp -r /etc/fonts /etc/fonts.old
Step 2: Migrate your local font via SCP.
scp -r -i file.pem /etc/fonts ec2-user@ec2-x-x-x-x.ap-northeast-1.compute.amazonaws.com:/etc/fonts
Step 3: Reset Font Cache
fc-cache
fc-cache -v | grep err (to check errors)
You can’t perform that action at this time.