This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
onny:notizen:programmierung [2022/02/22 13:26] – [postgresql] 46.223.163.98 | onny:notizen:programmierung [2022/09/05 13:43] – [javascript] 10.25.0.100 | ||
---|---|---|---|
Line 176: | Line 176: | ||
</ | </ | ||
===== javascript ===== | ===== javascript ===== | ||
+ | |||
split up javascript files | split up javascript files | ||
<code javascript> | <code javascript> | ||
Line 192: | Line 193: | ||
}(MODULE || {})); | }(MODULE || {})); | ||
</ | </ | ||
+ | |||
jquery select by attribute content | jquery select by attribute content | ||
+ | |||
<code javascript> | <code javascript> | ||
$( " | $( " | ||
Line 203: | Line 206: | ||
}); | }); | ||
</ | </ | ||
+ | |||
jquery set background color | jquery set background color | ||
+ | |||
<code javascript> | <code javascript> | ||
$(this).parent().css(" | $(this).parent().css(" | ||
Line 211: | Line 216: | ||
console.log(' | console.log(' | ||
</ | </ | ||
- | javascript | + | |
+ | on document ready | ||
<code javascript> | <code javascript> | ||
- | $(document).ready(function(){ | + | document.addEventListener(" |
- | | + | |
}); | }); | ||
+ | |||
</ | </ | ||
- | vanilla js change content text | + | |
+ | change content text | ||
<code javascript> | <code javascript> | ||
var webgl_field = document.getElementById(' | var webgl_field = document.getElementById(' | ||
Line 257: | Line 267: | ||
trim string to max length | trim string to max length | ||
+ | |||
<code javascript> | <code javascript> | ||
var string = string.substring(0, | var string = string.substring(0, | ||
+ | </ | ||
+ | |||
+ | onclick class element | ||
+ | |||
+ | <code javascript> | ||
+ | document.getElementsByClassName(' | ||
+ | console.log(' | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | smooth scrolling anchor links | ||
+ | |||
+ | <code javascript> | ||
+ | document.addEventListener(" | ||
+ | your_function(...); | ||
+ | }); | ||
</ | </ | ||
==== vuejs ==== | ==== vuejs ==== | ||
Line 571: | Line 598: | ||
[...] | [...] | ||
+ | | ||
+ | endif; | ||
+ | |||
+ | add_action( ' | ||
</ | </ | ||
Line 604: | Line 635: | ||
margin-left: | margin-left: | ||
} | } | ||
+ | </ | ||
+ | |||
+ | custom menu walker, only printing <a> tags without list items | ||
+ | <code php> | ||
+ | class Nav_Footer_Walker extends Walker_Nav_Menu { | ||
+ | |||
+ | function start_lvl( & | ||
+ | $indent = str_repeat(" | ||
+ | $output .= " | ||
+ | } | ||
+ | |||
+ | function end_lvl( & | ||
+ | $indent = str_repeat(" | ||
+ | $output .= " | ||
+ | } | ||
+ | |||
+ | function start_el( & | ||
+ | $indent = ( $depth ) ? str_repeat( " | ||
+ | |||
+ | $class_names = $value = ''; | ||
+ | |||
+ | $classes = empty( $item-> | ||
+ | $classes[] = ' | ||
+ | |||
+ | $class_names = join( ' ', apply_filters( ' | ||
+ | $class_names = $class_names ? ' class="' | ||
+ | |||
+ | $id = apply_filters( ' | ||
+ | $id = $id ? ' id="' | ||
+ | |||
+ | $output .= $indent . ''; | ||
+ | |||
+ | $attributes | ||
+ | $attributes .= ! empty( $item-> | ||
+ | $attributes .= ! empty( $item-> | ||
+ | $attributes .= ! empty( $item-> | ||
+ | |||
+ | $item_output = $args-> | ||
+ | $item_output .= '<a class=" | ||
+ | $item_output .= $args-> | ||
+ | $item_output .= '</ | ||
+ | $item_output .= $args-> | ||
+ | |||
+ | $output .= apply_filters( ' | ||
+ | } | ||
+ | |||
+ | |||
+ | function end_el( & | ||
+ | $output .= " | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | wp_nav_menu( array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ) ); | ||
+ | </ | ||
+ | |||
+ | customizer add option custom text | ||
+ | <code php> | ||
+ | function theme_customize_register( $wp_customize ) { | ||
+ | |||
+ | $wp_customize-> | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ),); | ||
+ | |||
+ | $wp_customize-> | ||
+ | $wp_customize, | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | ) ); | ||
+ | |||
+ | } | ||
+ | |||
+ | add_action( ' | ||
</ | </ | ||
===== sql ===== | ===== sql ===== | ||
Line 690: | Line 807: | ||
< | < | ||
pg_dump -U gitlab gitlabhq_production > / | pg_dump -U gitlab gitlabhq_production > / | ||
+ | </ | ||
+ | |||
+ | dump all | ||
+ | < | ||
+ | pg_dumpall > / | ||
</ | </ | ||
import database | import database | ||
< | < | ||
- | psql# CREATE DATABASE gitlabhq_production | + | psql# CREATE DATABASE gitlabhq_production; |
psql -U gitlab gitlabhq_production < gitlab.pgsql | psql -U gitlab gitlabhq_production < gitlab.pgsql | ||
</ | </ | ||
Line 702: | Line 824: | ||
DROP ROLE gitlab; | DROP ROLE gitlab; | ||
CREATE USER gitlab WITH PASSWORD ' | CREATE USER gitlab WITH PASSWORD ' | ||
+ | </ | ||
+ | |||
+ | grant permissions | ||
+ | < | ||
+ | ALTER USER gitlab SUPERUSER; | ||
+ | CREATE DATABASE gitlabhq_production OWNER gitlab; | ||
+ | ALTER DATABASE gitlabhq_production OWNER TO gitlab; | ||
</ | </ |