Skip to content

Instantly share code, notes, and snippets.

@itallix
itallix / cart.py
Last active August 25, 2022 20:05
class Product:
def __init__(self, name, price):
self.name = name
self.price = price
class User:
def __init__(self, login, balance=0):
self.login = login
self.balance = balance
Bugs:
- After page refreshes, the user loses sessions.
- Player names can match.
- The board creator cannot select naught or crosses in the board settings.
UX:
- You cannot send a link to the game.
- There is no indication that the WS connection is lost.
- You cannot specify a board name.
- There is no rule on the board during the game (current threshold).
- The threshold is not shown for the game while waiting to connect and in progress.
@itallix
itallix / keytool.sh
Created October 25, 2019 14:13
[keytool commands] #security
keytool -import -trustcacerts -alias [alias] -file [certificate_filename] -keystore $JAVA_HOME/jre/lib/security/cacerts
keytool -list -keystore $JAVA_HOME/jre/lib/security/cacerts | less
default pwd: changeit
@itallix
itallix / findElementByText.js
Created October 22, 2019 09:36
[find element by text] #enzyme #unit
const action2Button = wrapper.find('button[children="Action 2"]');
expect(action2Button).toHaveLength(1);
action2Button.simulate('click');
const button = wrapper.findWhere(node => {
return (
node.children().length === 0 &&
node.name() &&
node.text() === "Action 2"
);
public class Main {
private final static class Task implements Runnable {
private Object wait;
//private Object notify;
private int count;
private int number;
private boolean last = false;
package com.modernatx.lp.controller;
import com.modernatx.framework.commons.entity.WorkListOrderNote;
import com.modernatx.framework.commons.manager.WorkListManager;
import com.modernatx.framework.commons.util.Utils;
import com.modernatx.lp.controller.model.UpdateOrderNotesRequest;
import com.modernatx.lp.controller.model.WorkListOrderVO;
import com.modernatx.lp.controller.model.WorkListVO;
import org.codehaus.jackson.JsonNode;
import org.hamcrest.Matcher;
/**
* Moderna
*/
package com.modernatx.lp.controller;
import com.modernatx.framework.commons.entity.search.SearchSortOrder;
import com.modernatx.framework.commons.ordering.entity.BaseOrderItemRNA;
import com.modernatx.lp.controller.model.SearchFieldValue;
import com.modernatx.lp.controller.model.SearchRequest;
/**
* Moderna
*/
package com.modernatx.lp.controller;
import com.modernatx.framework.commons.entity.Application;
import com.modernatx.framework.commons.util.Utils;
import com.modernatx.lp.controller.model.LoadWorkListsByDateRangeRequest;
import com.modernatx.lp.controller.model.UpdateOrderNotesRequest;
import java.util.HashMap;
import java.util.IllegalFormatException;
import java.util.Map;
public class Main {
public static void main(String[] args) throws Exception
{
}
import java.util.HashMap;
import java.util.Map;
public class Main {
private static class Test {
Map<String, String> valuesMap = new HashMap<String, String>();
public void process(String initialString) throws Exception {