From https://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html
- ESC ] 0 ;
string
^G
Set string
as the title of the terminal window (works with some terminals, for example, iTerm).
0. ESC ] 0 ; string
ESC \
Set string
as the title of the screen tab.
0. An example of updating the terminal title with each new prompt in BASH:
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 | |
$key = '11'; // A key to be used in both examples | |
// Usual behavior: numeric strings are converted to numbers | |
$data = []; | |
$data[$key] = 38; | |
$data['12'] = 37; | |
echo var_export($data, 'return') . PHP_EOL; // notice keys are numbers | |
echo var_export(array_key_exists('12', $data), 'return') . PHP_EOL; // true | |
echo $data['12'] . PHP_EOL; // 37 |
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
<a href="http://lemonly.com/work/42-towel-day-infographic" title="42: Life, the Universe and Everything – A Towel Day Infographic by Lemonly"> | |
<img src="http://lemonly.com/wp-content/uploads/2013/05/Towel_Day-42-Infographic-960x2178.jpg"style="max-width: 100%" alt="42: Life, the Universe and Everything – A Towel Day Infographic Design by Lemonly" /> | |
</a> | |
Learn more about <a href="http://lemonly.com/work/42-towel-day-infographic">Towel Day </a> and <a href="http://lemonly.com">Infographic Design</a> from Lemonly. |
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
<a href="http://lemonly.com/work/celebrating-towel-day-may-25-2012" title="Don't Panic, Use a Towel Day Infographic"> | |
<img src="http://lemonly.com/wp-content/uploads/2012/05/Towel-day-Infographic2.jpg"style="max-width: 100%" alt="Don't Panic, Use a Towel Day Infographic; Design by Lemonly" /> | |
</a> | |
Learn more about <a href="http://lemonly.com/work/celebrating-towel-day-may-25-2012">Towel Day</a> and <a href="http://lemonly.com">Infographic Design</a> from Lemonly. |
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
/* | |
* The `DateTime` constructor doesn't create objects with fractional seconds. | |
* However, the static method `DateTime::createFromFormat()` does include the | |
* fractional seconds in the object. Finally, since ISO 8601 specifies only | |
* millisecond precision, remove the last three decimal places from the timestamp. | |
*/ | |
// DateTime object with microseconds | |
$now = DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', '')); |
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 | |
require_once 'vendor/autoload.php'; | |
/** | |
* Why doesn't PHP already have these defined? | |
*/ | |
class HttpMethods { | |
const | |
HTTP_METHOD_DELETE = 'DELETE', | |
HTTP_METHOD_GET = 'GET', |
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
// http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html | |
jQuery.githubUserRepositories = function(username, callback) { | |
jQuery.getJSON("https://api.github.com/users/" + username + "/repos?callback=?", callback); | |
} | |
jQuery.fn.loadRepositories = function(username) { | |
this.html("<span>Querying GitHub for repositories...</span>"); | |
var target = this; |
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 | |
define('TYPEHINT_PCRE', '/^Argument (\d)+ passed to (?:(\w+)::)?(\w+)\(\) must be an instance of (\w+), (\w+) given/'); | |
class Typehint { | |
private static $Typehints = array( | |
'boolean' => 'is_bool', | |
'integer' => 'is_int', | |
'float' => 'is_float', | |
'string' => 'is_string', | |
'resrouce' => 'is_resource' |
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
# coding: utf-8 | |
# from: https://forum.omz-software.com/topic/2271/beta-suggestion-safariviewcontroller/9 | |
from objc_util import * | |
import appex | |
SFSafariViewController = ObjCClass('SFSafariViewController') | |
def open_in_safari_vc(url): | |
vc = SFSafariViewController.alloc().initWithURL_entersReaderIfAvailable_(nsurl(url), True) |