Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections;
using System.Collections.Generic;
using Bizzkit.PIM.EndToEndTests.Helper.SeleniumTests.Helper;
using Bizzkit.PIM.EndToEndTests.Pages;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
// card reader
document.onkeypress = function(e) {
e = e || window.event;
var charCode = (typeof e.which == "number") ? e.which : e.keyCode;
// store it , in this example, i use localstorage
if(localStorage.getItem("card") && localStorage.getItem("card") != 'null') {
// append on every keypress
localStorage.setItem("card", localStorage.getItem("card") + String.fromCharCode(charCode));
} else {
@alpap
alpap / salt-ssh.md
Created September 14, 2018 15:09
Salt-ssh

Salt ssh deployment

Simple

  • Install the salt-ssh.

    sudo apt install salt-ssh
@alpap
alpap / index.html
Last active October 9, 2018 09:17
MIthrilJs Test
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="//unpkg.com/mithril/mithril.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/randomcolor/0.5.2/randomColor.min.js"></script>
local ret_status="%(?:%{$fg_bold[green]%} ▶ :%{$fg_bold[red]%} ▶ )"
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
RPS1="${return_code}" # ❦☙♨☁⚠⛬
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%} %{$fg[red]%}♨"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}"
@alpap
alpap / _service.md
Created June 20, 2017 23:09 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)