Skip to content

Instantly share code, notes, and snippets.

View robmazan's full-sized avatar

Robert Mazan robmazan

  • EPAM Systems
  • Szeged
View GitHub Profile
@robmazan
robmazan / debugFocus.js
Created November 2, 2020 15:32
Debug focus changes in browser
setInterval(() => (window.prevFocus !== document.activeElement) && (console.log(document.activeElement),window.prevFocus=document.activeElement), 500)
@robmazan
robmazan / countListeners.js
Created February 19, 2020 16:22
Count listeners under a subtree in Chrome DevTools
const countListeners = node => Array.from(node.children).reduce((acc, curr) => acc + countListeners(curr), Object.values(getEventListeners($0)).map(i => i.length).reduce((acc, curr) => acc + curr, 0))
@robmazan
robmazan / SketchSystems.spec
Last active February 27, 2019 08:00
Lead Changes
Lead Changes
Lead creation
ADAM batch upload -> NOT_YET_ISSUED
NOT_YET_ISSUED
Start campaign -> OPEN_AWAITING_ASSIGNMENT
Closed by ADAM -> CLOSED
OPEN_AWAITING_ASSIGNMENT
Assign -> OPEN_AWAITING_ACTION
Closed by ADAM -> CLOSED
Lead expired -> CLOSED
Reunion
Menu*
My Photos -> My Photos
My Photos
Menu -> Menu
My Photos Home*
# Upload
Send -> Selection Start
function docker-compose() {
if ($pwd.Path.StartsWith('C:\Users')) {
$projectName = Split-Path "$pwd" -leaf
$dockerPath = "/c" + $($($pwd -replace "^[a-z]:(.*)$",'$1') -replace "\\","/")
$dockerCmd = "docker run -v $dockerPath" + ":/$dockerPath -w $dockerPath -v /var/run/docker.sock:/var/run/docker.sock -e COMPOSE_PROJECT_NAME=$projectName -ti --rm dduportal/docker-compose:latest $args"
Write-Host $dockerCmd
Invoke-Expression $dockerCmd
} else {
Write-Error 'You must be under C:\Users, otherwise fileshare to boot2docker will not work!'
}
@robmazan
robmazan / SassMeister-input-HTML.html
Last active August 29, 2015 14:17
Generated by SassMeister.com.
<section class="some">
<p class="some__element">Hello</p>
</section>
@robmazan
robmazan / SassMeister-rendered.html
Last active August 29, 2015 14:17
Generated by SassMeister.com.
<div class="fonts-loaded">
<p class="para">
</p>
</div>
@robmazan
robmazan / bootstrap.sh
Created September 6, 2013 12:49
Vagrant tc Server provisioning
#!/usr/bin/env bash
function setJavaHome {
if grep -q "JAVA_HOME" /etc/environment; then
echo "JAVA_HOME already set..."
else
echo "Setting JAVA_HOME..."
echo "JAVA_HOME=$1" >> /etc/environment
fi
}
@robmazan
robmazan / log4j.xml
Created August 5, 2013 08:36
Hibernate SQL debug
<?xml version="1.0" encoding="UTF-8"?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<logger name="org.hibernate.SQL">
<level value="debug" />
</logger>
<logger name="org.hibernate.type">
<level value="trace" />
</logger>
</log4j:configuration>
@robmazan
robmazan / InitBinder.java
Created June 12, 2013 11:34
Spring Controller initBinder method with custom date format setup + IllegalArgumentExeption details suppressed.
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
binder.setBindingErrorProcessor(new DefaultBindingErrorProcessor() {
@Override
public void processPropertyAccessException(PropertyAccessException ex, BindingResult bindingResult) {
String propertyName = ex.getPropertyName();