Skip to content

Instantly share code, notes, and snippets.

View jonaskahn's full-sized avatar
🇩🇪
I'm on it

Jonas jonaskahn

🇩🇪
I'm on it
View GitHub Profile
@jonaskahn
jonaskahn / jsf-system-event.md
Last active May 7, 2019 09:10
Short explanation for How SystemEvent execute in JSF

How JSF Life Cycle execute SystemEvent

Look into current implementation

LifecycleImpl.java

    // Execute the phases up to but not including Render Response
    public void execute(FacesContext context) throws FacesException {

JSF LIFE CYCLES

Notes

Restore View

  • “Non Postback” requests: The “Non Postback” request refers to a new request to a page. If this case, the Restore View phase creates an empty UI components tree and stores it in the current FacesContext instance. For the “Non Postback” requests, the JSF life cycle directly proceeds to the last phase, which is the “Render Response” phase. In the “Render Response” phase, the empty UI components tree is populated with the JSF components in the page. Also, the UI components tree state is saved in the JSF view state for the next requests.
  • “Postback” requests: The “Postback” request occurs when the content of the form is submitted to the same page using the HTTP POST method. In this case, the Restore View phase restores the UI components tree from the JSF view state that was generated from the previous page request.

Apply Request Values

  • Note The “Apply Request Values” is applied to all the components which have a value attribute. In JSF, the compo
@jonaskahn
jonaskahn / move-clock-to-right-elementary-os.md
Last active March 13, 2024 15:01
Move clock to right elementary os

INSTALL

  • Get the latest code of wingpanel: https://github.com/elementary/wingpanel/releases
  • Extract and open terminal in source folder wingpanel-[version]
  • Open file Panel.vala, replace line center_menubar.add (indicator_entry); by right_menubar.insert_sorted (indicator_entry);
  • Open file IndicatorSorter.vala, add line indicator_order[Indicator.DATETIME] = 10; in contruct. Change indicator_order[Indicator.SESSION] = 10; to indicator_order[Indicator.SESSION] = 11;
  • Run command
        meson build --prefix=/usr
    
@jonaskahn
jonaskahn / docker-cleanup.sh
Last active August 5, 2020 04:30 — forked from StephanWagner/docker-cleanup.sh
Prune docker system and remove all containers, images, volumes with one command.
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)
docker system prune -a
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Meet</title>
<!-- change domain to match your Jitsi server -->
<script src='https://meet.jit.si/external_api.js'></script>
<style>
html {
#! /bin/sh
sudo curl -o /usr/local/bin/runb https://gist.githubusercontent.com/therealtuyen/320fdafabe1330dac586395e33cf7cd2/raw/863a22c48133d6947168c48bdeec1b50279682e4/run-in-batch.sh
sudo chmod a+x /usr/local/bin/runb
source ~/.bashrc >/dev/null 2>&1
source ~/.zshrc >/dev/null 2>&1
#!/bin/bash
sudo apt install -y unzip zip
export CONSUL_VERSION=1.13.4
printf "Download & install consul ${CONSUL_VERSION}\n"
export CONSUL_URL="https://releases.hashicorp.com/consul"
curl --silent --remote-name \
${CONSUL_URL}/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip
unzip consul_${CONSUL_VERSION}_linux_amd64.zip
sudo chown root:root consul
sudo mv consul /usr/bin/
#! /bin/bash
sudo apt install -y unzip zip
export NOMAD_VERSION=1.4.3
printf "Download & install nomad v${NOMAD_VERSION}\n"
curl --silent --remote-name https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip
unzip nomad_${NOMAD_VERSION}_linux_amd64.zip
sudo chown root:root nomad
sudo mv nomad /usr/local/bin/
nomad version
nomad -autocomplete-install
#!/bin/bash
sudo apt install -y unzip zip
export CONSUL_VERSION=1.13.4
printf "Download & install consul ${CONSUL_VERSION}\n"
export CONSUL_URL="https://releases.hashicorp.com/consul"
curl --silent --remote-name \
${CONSUL_URL}/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip
unzip consul_${CONSUL_VERSION}_linux_amd64.zip
sudo chown root:root consul
sudo mv consul /usr/bin/