Skip to content

Instantly share code, notes, and snippets.

View hidakatsuya's full-sized avatar
🏡
Working from home

Katsuya HIDAKA hidakatsuya

🏡
Working from home
View GitHub Profile
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@hidakatsuya
hidakatsuya / visitor_pass
Last active December 10, 2015 06:29 — forked from maeda-m/visitor_pass
# coding: utf-8
class VisitorPassController < ApplicationController
def create_pass
visitor = Visitor.find(params[:id])
report = ThinReports::Report.new layout: File.join(Rails.root, 'app', 'reports', 'visitor_pass.tlf')
report.start_new_page do |page|
# jpg_filepath method will return the path of JPEG file.
# e.g. "Rails.root/photos/visitor_001.jpg"
page.item(:photo).src(visitor.jpg_filepath)