Posts

Render Prawn pdf and rqrcode display QR with Ruby on rails -

creating ruby on rails web application qrcode display qr code in pdf iam using gem 'rqrcode-with-patches', require: 'rqrcode' gem 'prawn' my post controller show pdf view def show @qr=rqrcode::qrcode.new(request.url) respond_to |format| format.html format.pdf pdf = postpdf.new(@post) send_data pdf.render, filename: "post#{@post.id}.pdf", type: "application/pdf", disposition: "inline" end end end post_pdf class postpdf < prawn::document def initialize(post) super({top_margin: 30, page_size: 'a4', page_layout: :landscape }) @post = post post_id post_title qr_code end def post_id move_down 10 text "post id: #{@post.id}" end def post_title move_down 10 text "post title: #{@post.title}" end def qr_code move_down 10 @qr=rqrcode::qrcode.new(request.url) end end i got error on display pdf, i...

osx - Bash script: How to remote to a computer run a command and have output pipe to another computer? -

i need create bash script able ssh computer or machine b, run command , have output piped .txt file on machine how go doing this? list of computers ssh , run command of output append same .txt file on machine a. update: ok went , followed other guy suggested , seems work: file=/library/logs/file.txt ssh -n username@<ip> "$(< testscript.sh)" > $file what need instead of manually entering ip address, need have read list of hostnames coming .txt file , have place in variable substitute ip address. example be: ssh username@variable in "variable" changing each time word read file containing hostnames. ideas how go this? this should it ssh userb@machineb "some command" | ssh usera@machinea "cat - >> file.txt" with commands: ssh userb@machineb <<'end' | ssh usera@machinea "cat - >> file.txt" echo hostname=$(hostname) lastchecked=$(date) ls -l /applications/utilities/disk\ utility...

iron router - Meteor: How to implement text search on a collection along with other find queries in Meteor? -

i have app , users can create own private notes. i trying implement search function these notes. notes stored in collection schema: note = threadid: params.threadid date: date userid: user._id, html: params.html in router (using iron-router) use data function return users note data page: notes.find({threadid: @params._id}) then in jade iterate on note , show them each notes +note but want include search function user can search own notes. i want search html field of each note. want filter notes threadid field. basically this notes.find({threadid: @params._id}).search('test', field: {html: true}) which finds notes specific threadid field, , searches html field of notes query term 'test' and once find them, how update page new data? --------------------------------------update ----------------------------------------- so got searching working, loose reactivity on notes. kind of bummer. looking better way this. notes = note...

c# - Entity Framework Lazy Loading Does Not Work -

Image
i migrating project ef 4.0 ef 6.0. trying properties navigated entity after insert new entity. code runs without problem in ef 4.0 when try run in ef 6.0 gettin nullreference exception. user entity: public partial class users { public int rid { get; set; } public string name { get; set; } public nullable<int> langref { get; set; } public virtual language language { get; set; } } language entity: public partial class language { public language() { this.users = new hashset<users>(); } public int rid { get; set; } public string name { get; set; } public virtual icollection<users> users { get; set; } } test code: test1entities testent = new test1entities(); users user = new users(); user.name = "asd"; user.langref = 1;//that id refer english record in language entity testent.users.add(user); testent.savechanges(); string lang = user.language.name;//should return "english". language pro...

python - Where are flask-peewee's admin files? -

i'm trying deploy website made own server, , done, except admin page flask-peewee has no css styling. css files admin page stored, can serve them apache? if don't know i'm talking about, here's link: flask-peewee admin

Start javascript animation after an image has loaded -

i'm looking way initiate text animation after background image has loaded. specifically, h1 element should animate after div#image-bg has loaded it's background image. i'm using wow.js animate objects , developer's intention initiate movement on scroll. see full site issue exists, it's @ abbyaker.com. here's stripped version of html page: <html> <head> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/animate.css"> </head> <body> <div id="container"> <!-- - - - - - - - - - - - - - intro - - - - - - - - - - - - - --> <div id="headwrap"> <div id="image-bg"></div> <div id="intro"> <h1 class="white wow fadeinup" data-wow-duration="700ms" data-wow-delay="400ms">hello</h1> ...

sbt - How to copy config files as part of packaging for use in deployment? -

i use sbt 0.13.5 build project few config files meant human-edited after deployment. using sbt-native-packager 's stage command builds basic output directory structure deployment. results in bin folder start script , jars in lib folder. great. that leaves text config files should copied conf folder verbatim alonside bin/ , lib/ folders ( not included in jar ). how can copy these configuration files output directory on filesystem (not jars) using sbt? default universal convention copy files/directories under src/univeral/. so, include conf/ directory in distribution, add src/universal/conf , copy configuration files there. credit: this link