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 [2019/08/06 08:41] – [bottle] 2a02:8071:3eba:0:466d:57ff:fe22:1dfc | onny:notizen:programmierung [2023/03/08 11:18] – [python] 10.100.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== python ===== | ||
+ | using argparse | ||
+ | <code python> | ||
+ | import argparse | ||
+ | |||
+ | parser = argparse.ArgumentParser() | ||
+ | parser.add_argument(" | ||
+ | parser.add_argument(" | ||
+ | args = parser.parse_args() | ||
+ | |||
+ | if args.input: | ||
+ | if (args.input == " | ||
+ | [...] | ||
+ | </ | ||
+ | beautifulsoup example | ||
+ | <code python> | ||
+ | from bs4 import BeautifulSoup | ||
+ | soup = BeautifulSoup(req.content, | ||
+ | token = soup.findAll(" | ||
+ | </ | ||
+ | record, play and save sound | ||
+ | <code python> | ||
+ | import soundcard as sc | ||
+ | import soundfile as sf | ||
+ | import numpy | ||
+ | sound_device = sc.get_microphone(' | ||
+ | sound_device = sc.default_microphone() | ||
+ | data = sound_device.record(samplerate=48000, | ||
+ | sf.write("/ | ||
+ | default_speaker = sc.default_speaker() | ||
+ | default_speaker.play(data/ | ||
+ | </ | ||
+ | load json config | ||
+ | <code python> | ||
+ | import json | ||
+ | |||
+ | config = {} | ||
+ | with open(' | ||
+ | configfile = json.load(json_data) | ||
+ | config[' | ||
+ | suburl = config[' | ||
+ | </ | ||
+ | <code json> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | current date | ||
+ | <code python> | ||
+ | import datetime | ||
+ | date = datetime.datetime.now().strftime(" | ||
+ | </ | ||
+ | |||
+ | requests | ||
+ | |||
+ | <code python> | ||
+ | import requests | ||
+ | upstream_head = requests.head(upstream_url+url_param) | ||
+ | upstream_request = requests.get(upstream_url+url_param, | ||
+ | if (upstream_request.status_code == 302): | ||
+ | upstream_request = requests.get(upstream_url + upstream_head.headers[' | ||
+ | upstream_head = requests.head(upstream_url + upstream_head.headers[' | ||
+ | if (upstream_head.headers[' | ||
+ | upstream_response = upstream_response.replace("// | ||
+ | </ | ||
+ | |||
+ | class example | ||
+ | |||
+ | <code python> | ||
+ | class Planday: | ||
+ | auth_url = ' | ||
+ | client_id = ' | ||
+ | access_token = '' | ||
+ | |||
+ | def authenticate(self): | ||
+ | payload = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | headers = { | ||
+ | ' | ||
+ | } | ||
+ | session = requests.session() | ||
+ | session.trust_env = False | ||
+ | response = session.request(" | ||
+ | response = json.loads(response.text) | ||
+ | self.access_token = response[' | ||
+ | |||
+ | planday = Planday() | ||
+ | planday.authenticate() | ||
+ | </ | ||
+ | ==== ponyorm ==== | ||
+ | <code python> | ||
+ | from pony import orm | ||
+ | db = orm.Database() | ||
+ | |||
+ | class Article(db.Entity): | ||
+ | name = orm.Required(str) | ||
+ | date = orm.Required(str) | ||
+ | text = orm.Required(str) | ||
+ | title = orm.Required(str) | ||
+ | | ||
+ | @orm.db_session | ||
+ | def add_article(name, | ||
+ | Article(name=nane, | ||
+ | |||
+ | db.bind(provider=' | ||
+ | db.generate_mapping(create_tables=True) | ||
+ | |||
+ | add_article(" | ||
+ | |||
+ | with orm.db_session: | ||
+ | articles = orm.select(f for f in Article).order_by(lambda: | ||
+ | for article in articles: | ||
+ | print(article[" | ||
+ | </ | ||
+ | ==== bottle ==== | ||
+ | <code python> | ||
+ | import bottle | ||
+ | app = bottle.Bottle() | ||
+ | |||
+ | @app.get("/ | ||
+ | def index(): | ||
+ | return bottle.static_file(" | ||
+ | | ||
+ | @app.post("/ | ||
+ | def index(): | ||
+ | myname = bottle.request.forms.get(" | ||
+ | print(myname) | ||
+ | bottle.response.status = 200 | ||
+ | bottle.response.content_type = " | ||
+ | |||
+ | @app.get("/ | ||
+ | def index(page): | ||
+ | return bottle.template(' | ||
+ | |||
+ | if __name__ == ' | ||
+ | app.run(reloader=True, | ||
+ | else: | ||
+ | application = app | ||
+ | </ | ||
+ | template syntax | ||
+ | < | ||
+ | %for article in articles: | ||
+ | % categories = article.categories.split("," | ||
+ | < | ||
+ | < | ||
+ | <span class=" | ||
+ | % for index, category in enumerate(categories): | ||
+ | % category = category.strip() | ||
+ | <a href=" | ||
+ | % if (len(categories) > 1 and index != (len(categories)-1)): | ||
+ | {{category}}</ | ||
+ | % else: | ||
+ | {{category}}</ | ||
+ | % end | ||
+ | % end | ||
+ | </ | ||
+ | <p> | ||
+ | {{! article.text}} | ||
+ | < | ||
+ | % for i in range(5): | ||
+ | % if i >= article.rating: | ||
+ | <img src={{suburl}}/ | ||
+ | % else: | ||
+ | <i class=" | ||
+ | % end | ||
+ | % end | ||
+ | </p> | ||
+ | </ | ||
+ | %end | ||
+ | </ | ||
+ | ==== regex ==== | ||
+ | regex match between two special chars | ||
+ | <code python> | ||
+ | pat = r' | ||
+ | s = " | ||
+ | match = re.search(pat, | ||
+ | match.group(1) | ||
+ | "' | ||
+ | </ | ||
+ | regex findall | ||
+ | <code python> | ||
+ | regex = re.compile(' | ||
+ | it = re.finditer(regex, | ||
+ | |||
+ | for match in it: | ||
+ | print (match.group(0)) | ||
+ | </ | ||
+ | find/search text html tags | ||
+ | <code python> | ||
+ | re_search_pat = r' | ||
+ | match = re.search(re_search_pat, | ||
+ | site_title = match.group(1) | ||
+ | </ | ||
+ | strip all specific html tags | ||
+ | <code python> | ||
+ | upstream_response = re.sub(r'< | ||
+ | </ | ||
+ | ===== javascript ===== | ||
+ | |||
+ | split up javascript files | ||
+ | |||
+ | <code javascript> | ||
+ | var MODULE = (function (my) { | ||
+ | var privateToThisFile = " | ||
+ | |||
+ | // add capabilities... | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | alert(" | ||
+ | }); | ||
+ | |||
+ | return my; | ||
+ | }(MODULE || {})); | ||
+ | </ | ||
+ | |||
+ | on document ready | ||
+ | |||
+ | <code javascript> | ||
+ | document.addEventListener(" | ||
+ | your_function(...); | ||
+ | }); | ||
+ | |||
+ | </ | ||
+ | |||
+ | change content text | ||
+ | |||
+ | <code javascript> | ||
+ | var webgl_field = document.getElementById(' | ||
+ | if (webgl_support()) { | ||
+ | webgl_field.textContent = " | ||
+ | } else { | ||
+ | webgl_field.textContent = " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ajax post form | ||
+ | |||
+ | <code javascript> | ||
+ | document.getElementById(' | ||
+ | | ||
+ | var form = document.querySelector(' | ||
+ | var form_data = new FormData(form); | ||
+ | var request = new XMLHttpRequest(); | ||
+ | request.onreadystatechange = function() { | ||
+ | if(request.readyState === 4) { | ||
+ | if(request.status === 200) { | ||
+ | location.reload(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | request.open(' | ||
+ | request.send(form_data); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | change style element | ||
+ | |||
+ | <code javascript> | ||
+ | function show_create_post() { | ||
+ | var x = document.getElementById(" | ||
+ | if (x.style.display === " | ||
+ | x.style.display = " | ||
+ | } else { | ||
+ | x.style.display = " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | trim string to max length | ||
+ | |||
+ | <code javascript> | ||
+ | var string = string.substring(0, | ||
+ | </ | ||
+ | |||
+ | onclick class element | ||
+ | |||
+ | <code javascript> | ||
+ | document.getElementsByClassName(' | ||
+ | console.log(' | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | onclick on all class elements | ||
+ | |||
+ | <code javascript> | ||
+ | # old: var anchors = document.getElementsByClassName(' | ||
+ | let allCheckBox = document.querySelectorAll(' | ||
+ | |||
+ | allCheckBox.forEach((checkbox) => { | ||
+ | checkbox.addEventListener(' | ||
+ | if (event.target.checked) { | ||
+ | console.log(event.target.value) | ||
+ | } | ||
+ | }) | ||
+ | }) | ||
+ | </ | ||
+ | |||
+ | remove class from element | ||
+ | |||
+ | <code javascript> | ||
+ | var element = document.getElementsByClassName(' | ||
+ | element.classList.remove(" | ||
+ | </ | ||
+ | |||
+ | get url and pathname | ||
+ | |||
+ | <code javascript> | ||
+ | console.log(window.location.url) | ||
+ | console.log(window.location.pathname) | ||
+ | </ | ||
+ | |||
+ | querySelector | ||
+ | |||
+ | <code javascript> | ||
+ | var multicolumnHeadline = document.querySelector(' | ||
+ | </ | ||
+ | |||
+ | querySelectorAll | ||
+ | |||
+ | <code javascript> | ||
+ | var productAccordion = document.querySelectorAll(' | ||
+ | productAccordion[1].style.display = " | ||
+ | </ | ||
+ | ==== vuejs ==== | ||
+ | |||
+ | add data to attribute string, for example ``<a href`` | ||
+ | <code javascript> | ||
+ | <a : | ||
+ | </ | ||
+ | |||
+ | on click change route | ||
+ | <code javascript> | ||
+ | <div | ||
+ | v-lazy: | ||
+ | class=" | ||
+ | @click=" | ||
+ | </ | ||
+ | |||
+ | watch data or property change | ||
+ | <code javascript> | ||
+ | props: { | ||
+ | podcasts: { | ||
+ | type: Array, | ||
+ | default() { return [] }, | ||
+ | }, | ||
+ | }, | ||
+ | watch: { | ||
+ | podcasts(newValue, | ||
+ | const slider = this.$refs.slider | ||
+ | console.log(slider.scrollLeft, | ||
+ | if (slider.scrollWidth > slider.clientWidth) { | ||
+ | this.showNext = true | ||
+ | } | ||
+ | }, | ||
+ | }, | ||
+ | </ | ||
+ | |||
+ | reference html element | ||
+ | <code javascript> | ||
+ | <div class=' | ||
+ | |||
+ | [...] | ||
+ | |||
+ | export default { | ||
+ | name: ' | ||
+ | computed: { | ||
+ | isOverflowing() { | ||
+ | var element = this.$refs.cartList; | ||
+ | return (element.offsetHeight < element.scrollHeight || element.offsetWidth < element.scrollWidth) | ||
+ | } | ||
+ | } | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | commit / pass more than one parameter to store action-method | ||
+ | <code javascript> | ||
+ | methods: { | ||
+ | ...mapActions([ | ||
+ | ' | ||
+ | ]), | ||
+ | |||
+ | async loadEpisodes(page) { | ||
+ | const response = await this.queryEpisodes({ page, sortBy: ' | ||
+ | [...] | ||
+ | }, | ||
+ | |||
+ | # store/ | ||
+ | |||
+ | actions: { | ||
+ | async queryEpisodes({ commit, getters }, { page, sortBy } = {}) { | ||
+ | const response = await episodeApiClient.queryEpisodes(null, | ||
+ | [...] | ||
+ | }, | ||
+ | </ | ||
+ | |||
+ | ==== frameworks ==== | ||
+ | |||
+ | * pushy animated side menu https:// | ||
+ | |||
+ | ===== html ===== | ||
+ | starting template | ||
+ | <code html> | ||
+ | < | ||
+ | <html lang=" | ||
+ | < | ||
+ | <meta data-react-helmet=" | ||
+ | <meta name=" | ||
+ | </ | ||
+ | include remote js file | ||
+ | <code html> | ||
+ | <script src=" | ||
+ | </ | ||
+ | include remote css file | ||
+ | <code html> | ||
+ | <link rel=" | ||
+ | </ | ||
+ | include javascript inside html document | ||
+ | <code html> | ||
+ | <script language=" | ||
+ | alert(" | ||
+ | </ | ||
+ | </ | ||
+ | css within html | ||
+ | <code css> | ||
+ | <style type=" | ||
+ | nav.main { | ||
+ | background-color: | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | footer bottom page | ||
+ | <code html> | ||
+ | < | ||
+ | < | ||
+ | <style type=" | ||
+ | |||
+ | body { | ||
+ | margin: 0 !important; | ||
+ | padding: 0 !important; | ||
+ | } | ||
+ | |||
+ | article { | ||
+ | min-height: 100vh; | ||
+ | display: grid; | ||
+ | grid-template-rows: | ||
+ | grid-template-columns: | ||
+ | } | ||
+ | |||
+ | main { | ||
+ | background: whitesmoke; | ||
+ | padding: 1rem; | ||
+ | } | ||
+ | |||
+ | footer { | ||
+ | background: purple; | ||
+ | padding: 1rem; | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | <strong contenteditable> | ||
+ | </ | ||
+ | < | ||
+ | All rights reversed. | ||
+ | <br> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | css easy center div box content vertical and horizontal align | ||
+ | <code css> | ||
+ | display: flex; | ||
+ | justify-content: | ||
+ | align-items: | ||
+ | </ | ||
+ | advanced | ||
+ | <code css> | ||
+ | body { | ||
+ | margin: 0 !important; | ||
+ | padding: 0 !important; | ||
+ | display: flex; | ||
+ | justify-content: | ||
+ | align-items: | ||
+ | flex-direction: | ||
+ | opacity: 1; | ||
+ | height: 100vh; | ||
+ | } | ||
+ | </ | ||
+ | ===== css ===== | ||
+ | sweet font styling | ||
+ | <code css> | ||
+ | font-family: | ||
+ | font-size: 125%; | ||
+ | line-height: | ||
+ | </ | ||
+ | media queries, page greater than 600px | ||
+ | <code css> | ||
+ | @media (min-width: 600px) { | ||
+ | article { | ||
+ | min-width: 600px; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | popover menu | ||
+ | <code css> | ||
+ | .main-navigation ul li ul.sub-menu { | ||
+ | opacity: 0; | ||
+ | position: absolute; | ||
+ | box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); | ||
+ | transition: | ||
+ | padding: 20px; | ||
+ | z-index: 2; | ||
+ | left: 17px; | ||
+ | background: | ||
+ | } | ||
+ | |||
+ | .main-navigation ul li:hover ul.sub-menu { | ||
+ | opacity: 1; | ||
+ | transition: | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | responsive grid layout | ||
+ | < | ||
+ | ul { | ||
+ | display: grid; | ||
+ | grid-gap: 50px 40px; | ||
+ | grid-template-columns: | ||
+ | } | ||
+ | </ | ||
+ | ===== php ===== | ||
+ | enable debugging / error log | ||
+ | <file - / | ||
+ | display_startup_errors = true | ||
+ | display_errors = true | ||
+ | html_errors = true | ||
+ | log_errors = true | ||
+ | track_errors = true | ||
+ | error_log = / | ||
+ | </ | ||
+ | < | ||
+ | touch / | ||
+ | chmod a+w+r / | ||
+ | </ | ||
+ | foreach loop | ||
+ | <code php> | ||
+ | foreach($this-> | ||
+ | $this-> | ||
+ | $track = $trackList-> | ||
+ | $track-> | ||
+ | $track-> | ||
+ | $track-> | ||
+ | } | ||
+ | </ | ||
+ | get array length | ||
+ | <code php> | ||
+ | var_dump(count($a)); | ||
+ | </ | ||
+ | |||
+ | get type of variable | ||
+ | <code php> | ||
+ | foreach($data as $episode) { | ||
+ | $this-> | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | convert string to int | ||
+ | <code php> | ||
+ | intval(" | ||
+ | </ | ||
+ | convert array to string | ||
+ | <code php> | ||
+ | foreach($data as $episode) { | ||
+ | $this-> | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== nextcloud app dev ==== | ||
+ | logging, available methods: emergency, alert, critical, error, warning, notice, info, debug | ||
+ | <code php> | ||
+ | use OCP\ILogger; | ||
+ | |||
+ | class EpisodeController extends Controller { | ||
+ | |||
+ | /** @var ILogger */ | ||
+ | private $logger; | ||
+ | |||
+ | [...] | ||
+ | |||
+ | public function __construct(IRequest $request, | ||
+ | EpisodeService $service, | ||
+ | FyydApiService $fyydapi, | ||
+ | ILogger $logger, | ||
+ | $userId) { | ||
+ | parent:: | ||
+ | $this-> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | [...] | ||
+ | |||
+ | public function log($message) { | ||
+ | $this-> | ||
+ | /* $this-> | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== wordpress ==== | ||
+ | registering menus | ||
+ | <code php functions.php> | ||
+ | if ( ! function_exists( ' | ||
+ | |||
+ | function iaro_setup() { | ||
+ | | ||
+ | [...] | ||
+ | |||
+ | register_nav_menus( | ||
+ | array( | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | ); | ||
+ | |||
+ | [...] | ||
+ | | ||
+ | endif; | ||
+ | |||
+ | add_action( ' | ||
+ | </ | ||
+ | |||
+ | customize menu entries, wrap entry into span element | ||
+ | <code php functions.php> | ||
+ | add_filter(' | ||
+ | if ($args-> | ||
+ | $title | ||
+ | $args-> | ||
+ | $args-> | ||
+ | } | ||
+ | return $args; | ||
+ | }, 10, 3); | ||
+ | </ | ||
+ | |||
+ | check if query is front page | ||
+ | <code php> | ||
+ | if ( is_front_page() ) : | ||
+ | get_header( ' | ||
+ | else : | ||
+ | get_header(); | ||
+ | endif; | ||
+ | </ | ||
+ | |||
+ | add support for wide / full images | ||
+ | <code php functions.php> | ||
+ | add_theme_support( ' | ||
+ | </ | ||
+ | |||
+ | <code css styles.css> | ||
+ | .alignfull { | ||
+ | width: 100vw; | ||
+ | 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( ' | ||
+ | </ | ||
+ | |||
+ | add custom javascript js | ||
+ | |||
+ | <code php> | ||
+ | function twentytwentytwo_enqueue_custom_js() { | ||
+ | wp_enqueue_script(' | ||
+ | } | ||
+ | |||
+ | add_action( ' | ||
+ | </ | ||
+ | ===== sql ===== | ||
+ | Update field: | ||
+ | <code sql> | ||
+ | update forwardings set destination=' | ||
+ | </ | ||
+ | Insert field: | ||
+ | <code sql> | ||
+ | insert into forwardings (source, destination) VALUES (' | ||
+ | insert into forwardings VALUES (' | ||
+ | </ | ||
+ | Delete row: | ||
+ | <code sql> | ||
+ | delete from domains where domain=' | ||
+ | </ | ||
+ | <code sql> | ||
+ | mysql> \P / | ||
+ | PAGER set to / | ||
+ | </ | ||
+ | Delete all rows: | ||
+ | <code sql> | ||
+ | truncate my_table; | ||
+ | </ | ||
+ | Create database: | ||
+ | <code sql> | ||
+ | CREATE DATABASE roundcubemail; | ||
+ | GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@' | ||
+ | FLUSH PRIVILEGES; | ||
+ | </ | ||
+ | delete user: | ||
+ | <code sql> | ||
+ | DROP user gitlab@' | ||
+ | </ | ||
+ | |||
+ | ==== mysql ==== | ||
+ | |||
+ | delete specific row | ||
+ | < | ||
+ | delete from oc_storages where numeric_id=58; | ||
+ | </ | ||
+ | |||
+ | remove user | ||
+ | <code sql> | ||
+ | DROP USER ' | ||
+ | </ | ||
+ | |||
+ | adjust permissions to table | ||
+ | <code sql> | ||
+ | CREATE USER ' | ||
+ | GRANT ALL PRIVILEGES ON ninja.* TO ' | ||
+ | GRANT ALL PRIVILEGES ON ninja.* TO ' | ||
+ | FLUSH PRIVILEGES; | ||
+ | </ | ||
+ | |||
+ | update statement | ||
+ | |||
+ | <code sql> | ||
+ | UPDATE wp_options SET option_value = ' | ||
+ | </ | ||