View gist:73e20123b4a30941bf08
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
% pwd | |
/tmp/ex | |
% mkdir old | |
% echo "0xFF 255 11111111" > old/stuff | |
% echo "192.168.0.0/16" > old/net | |
% cp -R old new | |
% echo "192.168.2.0/24" > old/net | |
% echo "0xF0 240 11110000" > old/stuff | |
% diff -r -u old/ new/ > patchfile | |
% cat patchfile |
View gist:2ff31862b477537c4792
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
% docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
0069ffd119ae mysql:5 "/entrypoint.sh mysq 7 minutes ago Up 7 minutes 0.0.0.0:49153->3306/tcp mysql | |
% mysql -u root -h 192.168.59.103 -P 49153 -p | |
Enter password: | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 2 | |
Server version: 5.6.24 MySQL Community Server (GPL) | |
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. |
View wymeditor_destroy.js
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
/** | |
* destroy instance of wymeditor: | |
* - updates content between iframe and textarea | |
* - remove iframe | |
* - show textarea | |
* - replace element with undefined (to trick jQuery.getWymeditorByTextarea(el)) | |
* @see https://github.com/wymeditor/wymeditor/blob/master/src/wymeditor/core.js#L520 | |
* @param {WYMeditor.editor} instance | |
*/ | |
var wymeditor_destroy = function (instance) { |
View gist:0084ef46c3aab5b8f931
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
$ perl -mIO::Socket -e 'my $s = new IO::Socket::INET(Listen => 1, LocalAddr => "localhost", LocalPort => 8888, Proto => "tcp"); my $data = $s->accept(); while (<$data>) { print $_; } close($s);' |
View gist:9f876ead1241ff0d141d
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 | |
/** | |
* Plugin Name: XMLRPC archive | |
* Plugin Uri: http://localhost/ | |
* Description: Extend Wordpress API to get archives | |
* Version 1.0 | |
* Author: John Doe | |
*/ | |
View gist:c1127438c10dd36e3aec
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 | |
$entity = 'node'; | |
$field_name = 'employee_first_name'; | |
$bundle = 'employee'; | |
$lang_code = 'fi'; | |
$value = 'Nimi'; | |
// get field instance | |
$instance = field_info_instance($entity, $field_name, $bundle); |