This file contains 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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains 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 | |
""" | |
An example demonstrating how to use xpyb (xcb bindings for Python) to take a | |
full-screen screenshot. | |
""" | |
# Meta | |
__version__ = '1.0' | |
__version_info__ = (1, 0) |
This file contains 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 | |
// https://github.com/tazotodua/useful-php-scripts | |
//optional: 5th parameter - backup specific tables only: array("mytable1","mytable2",...) | |
//optional: 6th parameter - backup filename | |
// NOTE! to adequatelly replace strings in DB, MUST READ: goo.gl/2fZDQL | |
function EXPORT_TABLES($host,$user,$pass,$name, $tables=false, $backup_name=false){ | |
set_time_limit(3000); $mysqli = new mysqli($host,$user,$pass,$name); $mysqli->select_db($name); $mysqli->query("SET NAMES 'utf8'"); | |
$queryTables = $mysqli->query('SHOW TABLES'); while($row = $queryTables->fetch_row()) { $target_tables[] = $row[0]; } if($tables !== false) { $target_tables = array_intersect( $target_tables, $tables); } | |
$content = "SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\r\nSET time_zone = \"+00:00\";\r\n\r\n\r\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\r\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\r\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\r\n/*!401 |
This file contains 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 bash | |
# For a vastly more feature-rich tool, have a look at | |
# https://gist.github.com/Ohcanep/48dac84c5916821d150c545a6eb12547 | |
# https://gist.github.com/wandernauta/6800547 (original) | |
DEST="org.mpris.MediaPlayer2.spotify" | |
OBJECT_PATH="/org/mpris/MediaPlayer2" | |
INTERFACE="org.mpris.MediaPlayer2.Player" |