This document has been moved to https://selenium-python.readthedocs.org/en/latest/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| q = { | |
| "query": { | |
| "function_score": { | |
| "boost_mode": "replace", | |
| "query": { | |
| "ids": { | |
| "values": [ | |
| 50, | |
| 80, | |
| 44, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const h = (tag, attrs, ...children) => { | |
| const elm = document.createElement(tag) | |
| for (let key in attrs) { | |
| if (key.slice(0, 2) == 'on') { | |
| const evtName = key.slice(2) | |
| const cb = attrs[key] | |
| if (cb == null) continue // we can use null or undefnied to suppress | |
| elm.addEventListener(evtName, cb) | |
| } else if (['disabled', 'autocomplete', 'selected', 'checked'].indexOf(key) > -1) { | |
| if (attrs[key]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Note: there are some references to WordPress methods and functions | |
| class cf7_export_excel { | |
| protected $doc_prop = array( | |
| 'Author' => 'Name', | |
| 'Company' => 'Company', | |
| 'Created' => '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux | |
| # Log in as root | |
| # Mount ramdisk folder in RAM | |
| mkdir /tmp/ramdisk | |
| mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/ | |
| # Move MySQL data | |
| mv /var/lib/mysql /tmp/ramdisk/mysql | |
| ln -s /tmp/ramdisk/mysql/ /var/lib/mysql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Based on: http://wordpress.stackexchange.com/questions/42652/#answer-42729 | |
| These functions provide a simple way to interact with TinyMCE (wp_editor) visual editor. | |
| This is the same thing that WordPress does, but a tad more intuitive. | |
| Additionally, this works for any editor - not just the "content" editor. | |
| Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Homepage Settings for BigBang | |
| Plugin URI: http://www.inboundnow.com/ | |
| Description: Adds additional functionality to the big bang theme. | |
| Author: David Wells | |
| Author URI: http://www.inboundnow.com | |
| */ | |
| // Specify Hooks/Filters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // iframe | |
| var youtubePlayer = document.getElementsByClassName('youtube-player')[0]; | |
| // play | |
| youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); | |
| // pause | |
| youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); | |
| // stop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| import os | |
| import shlex | |
| from subprocess import Popen, PIPE | |
| def execute_in_virtualenv(virtualenv_name, commands): | |
| '''Execute Python code in a virtualenv, return its stdout and stderr.''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ($request_uri = /) { | |
| set $test A; | |
| } | |
| if ($host ~* teambox.com) { | |
| set $test "${test}B"; | |
| } | |
| if ($http_cookie !~* "auth_token") { | |
| set $test "${test}C"; |
NewerOlder