Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@yaxinr
yaxinr / README.MD
Last active April 17, 2019 04:40
emberjs printing

I need print badges on landscape format. I add route /badges. Then on this route printing page size must be landscape.

In controllers/application.coffee i observe currentPath and add html head style {@page:size: controller.size}. In badges controller set size prop to landscape

Also i set to row class style page-break-inside: avoid And add class print-color with style print-color-adjust: exact for print color

gist

@yaxinr
yaxinr / ssh-keygen.pb.yml
Created April 10, 2019 20:26
ssh-keygen
- hosts: all
become: true
gather_facts: false
tasks:
- name: Generate /etc/ssh/ RSA host key
command : ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C "" -N ""
args:
creates: /etc/ssh/ssh_host_rsa_key
@yaxinr
yaxinr / playbook1.yml
Last active April 10, 2019 19:42
bashrc systemctl alias
- hosts: all
become: true
gather_facts: false
vars:
bashrc: /etc/bash.bashrc
tasks:
- name: alias to systemctl
lineinfile:
path: "{{ bashrc }}"
line: alias 'status'='sudo systemctl status'
@yaxinr
yaxinr / go
Last active June 28, 2022 19:32
invoke(call) struct method in golang
package myreflect
import (
"fmt"
"reflect"
)
// Invoke - firstResult, err := invoke(AnyStructInterface, MethodName, Params...)
func Invoke(any interface{}, name string, args ...interface{}) (reflect.Value, error) {
method := reflect.ValueOf(any).MethodByName(name)