Skip to content

Instantly share code, notes, and snippets.

@osv
osv / vast.v3.example.xml
Created September 20, 2021 13:00
Vast 3 example
<?xml version="1.0"?>
<VAST version="3.0">
<Ad>
<InLine>
<AdSystem>Example Ad system</AdSystem>
<AdTitle>Example title</AdTitle>
<Description>KayzenRTB</Description><Impression><![CDATA[http://imp.url]]></Impression>
<Creatives>
<Creative>
<Linear>
<VAST version="2.0">
<Ad>
<Wrapper>
<VASTAdTagURI><![CDATA[ https://ad.doubleclick.net/ddm/pfadx/N624.2192503PERMODOGMBH/B24335141.275967726;sz=0x0;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;dcmt=text/xml;dc_sdk_apis=[APIFRAMEWORKS];dc_omid_p=[OMIDPARTNER] ]]></VASTAdTagURI>
</Wrapper>
</Ad>
</VAST>
xscreensaver &
kbdd
sleep 10
setxkbmap -layout "us,ru(winkeys),ua(winkeys)" -option grp:menu_toggle,grp_led:scroll
upstream my-web-app-here {
server 127.0.0.1:8080;
}
server {
listen 80;
listen 443 ssl http2;
listen [::]:80;
listen [::]:443 ssl http2;
@osv
osv / formikGotoErrorOnSubmitEffect.tsx
Last active March 4, 2019 07:24
React Formik, scroll to first element in DOM that is not valid and has error (Hook + Typescript version)
import { connect, FormikContext, getIn } from 'formik';
import * as React from 'react';
import { useEffectWhenCountIncremented } from './reactHooks';
import { PageContext } from './context';
const FormikGotoErrorOnSubmitEffectFn: React.FunctionComponent<{
formik?: FormikContext<any>;
}> = ({ formik }) => {
@osv
osv / readme.md
Last active February 6, 2018 21:05
Timestamp standard input with relative timestamp and less noise using node.js

Pretty formatter with relative time stamp, inspired by moreutils ts but with less noise, print only changes :)

Install

Save file

chmod +x ts.js

Example of usage

@osv
osv / decorate state go.js
Last active March 30, 2017 12:41
I use it in dev console to debug $state.go calls
var $state = angular.element(document).injector().get('$state');
var go = $state.go;
$state.go = function(...x) {
console.trace('!! state.go(', angular.copy(x), ')'); return go.apply($state, x)
};
@osv
osv / e2e-in-docker-update-images
Last active February 16, 2017 09:28
Copy from actual to baseline image when test is failes
#!/bin/bash
#
# Update baseline image from "actual" directory if test is failed.
#
# This script parse stdin for "Expected false to be true, 'screenshot " message
# and copies image file from "actual" to "baseline" directory
#
# Example of usage
# e2e/foo.spec.js:
# it('matches screenshots', async () => {
String.prototype.template = function (object) {
// Andrea Giammarchi - WTFPL License
var
stringify = JSON.stringify,
re = /\$\{(.*?)\}/g,
evaluate = [],
i = 0,
m
;
while (m = re.exec(this)) {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XX:TITLE</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
</head>