Skip to content

Instantly share code, notes, and snippets.

View olostan's full-sized avatar

Valentyn Shybanov olostan

View GitHub Profile
@olostan
olostan / messages
Created February 11, 2024 23:37
shutdown logs (failed)
2024-02-11T23:23:27.257276Z NOTICE powerd_suspend[21444]: Resume finished
2024-02-11T23:23:27.272573Z INFO smbproviderd[5190]: smbproviderd stopping with exit code 0
2024-02-11T23:23:27.273646Z INFO cups_launcher[1901]: Stopping after signal received
2024-02-11T23:23:27.274204Z INFO psm_device_active[4504]: Private Computing daemon is stopping with exit code 0
2024-02-11T23:23:27.280108Z INFO iioservice[860]: INFO iioservice: [sensor_device_fusion.cc(539)] (2) OnSensorDeviceDisconnect(): SensorDevice disconnected. ReceiverId: 0
2024-02-11T23:23:27.280117Z ERR iioservice[860]: ERROR iioservice: [samples_handler_base.cc(180)] (2) RemoveClientOnThread(): Failed to RemoveClient: Client not found
2024-02-11T23:23:27.280159Z INFO iioservice[860]: INFO iioservice: [sensor_device_impl.cc(569)] (2) OnSensorDeviceDisconnect(): SensorDevice disconnected. ReceiverId: 7
2024-02-11T23:23:27.280187Z INFO iioservice[860]: INFO iioservice: [sensor_device_impl.cc(569)] (2) OnSensorDeviceDisconnect(): SensorDevice disconnected.
document.addEventListener ("keydown", function (zEvent) {
if (zEvent.ctrlKey && zEvent.altKey && zEvent.key === "1") { // case sensitive
document.querySelectorAll('mat-radio-group input')[0].click(); document.querySelectorAll('button')[1].click() }
} );
document.addEventListener ("keydown", function (zEvent) {
if (zEvent.ctrlKey && zEvent.altKey && zEvent.key === "2") { // case sensitive
document.querySelectorAll('mat-radio-group input')[1].click(); document.querySelectorAll('button')[1].click() }
} );
@olostan
olostan / calculator.pl
Created February 27, 2017 09:00
Price Calculator - Test Assigment (perl)
use List::Util qw(reduce sum);
use POSIX;
# Pricelist
%P = ( "A" => [1.25, 3, 3], "B" => 4.25, "C" => [1,6,5], D=> 0.75 );
# Sale scanning
$_{$_}++ for split (//,qw(ABCDABA));
# Calculate total
@olostan
olostan / example.html
Last active January 27, 2017 15:27
Angular 1 substitution
<ui:substitute
placeholder-link-value='registration.link' placeholder-link-action='showTermsAndConditions(2)'
placeholder-user-value='registration.user'
placeholder-date-value='registration.date' placeholder-date-class="'stage-connect'"
placeholder-name-value='::name'>
The [link] have been agreed by [user] on [date], and name is [name]
</ui:substitute>
@olostan
olostan / toasync.js
Last active December 12, 2016 20:38
Convert call-back style functions into async/await
function toAsyncFunction(f, thisObj) {
return function () {
let args = Array.prototype.slice.call(arguments);
return new Promise(function (resolve, reject) {
args.push(function (err, result) {
if (err) reject(err);
else resolve(result);
});
f.apply(thisObj, args);
<div class="cost"> <span class="details">Cruise Only from</span> <span class="price" data-precision="0"><span class="small">&pound;</span>1249<span class="small">pp</span></span>
<div class="clear"></div>
</p></div>
package main
import (
"log"
"net/http"
"net/http/httputil"
"fmt"
)
type proxyHandler struct {
binding string
@olostan
olostan / ReadMe.md
Last active November 4, 2016 09:46

Running app

Running locally without container

If you want to run app locally without container (useful for development), you need

  • Have MongoDB and Redis available. Set environment variables MONGO and REDIS where those servers are located. Value should be in format http://<db-service-host>:<db-service-port>. Example
@olostan
olostan / ddoconvertor.html
Created April 14, 2016 16:23
Converts from Directive Definition to Directive
<html>
<body>
<textarea id="a" cols=80 rows=20>@directiveDefinition("viewControlPanel", [])
export class ControlPanelView implements ng.IDirective {
restrict = 'E';
template = controlPanelViewTemplate;
bindToController = { activity: '=' };
controller = controlPanelViewController;
controllerAs = "ctrl";
require = { payload: "^uifDataPayload" };
@olostan
olostan / annotations.ts
Created April 7, 2016 23:38
TypeScript Annotations for Angular 1 (full version)
import * as ng from 'angular';
interface Function {
(...any):any;
$inject?: any;
injectableType?: string;
injectableName?: string;
}
type BindingType = '<' | '@' | '&' | '=';