- Froala - https://www.froala.com/wysiwyg-editor - solid editor, most flexible and feature filled
- Trix - https://github.com/basecamp/trix - by Basecamp team and used in v3
- Scribe - https://github.com/guardian/scribe - by the Guardian team
- Draft - https://jpuri.github.io/react-draft-wysiwyg - built on ReactJS
- Slate - https://github.com/ianstormtaylor/slate - framework to build more customized editors
- Squire - https://github.com/neilj/Squire - used in FastMail webmail, better for text than images
- CKEditor - http://ckeditor.com/ - solid and very customizable, lots of plugins, now dated in look/feel
- ProseMirror - http://prosemirror.net/ - real-time collaboration features, not great with images
- Quill - http://quilljs.com/
- Summernote - http://summernote.org/
php module mysqlnd_ms
mysqlnd_ms.enable = On
mysqlnd_ms.config_file = /etc/mysqlnd_ms_plugin.ini
mysqlnd_ms.multi_master = On
mysqlnd_ms.collect_statistics = On
mysqlnd_ms.force_config_usage = On
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 | |
class TimeoutException extends RuntimeException {} | |
class Timeout | |
{ | |
private $active; | |
public function set($seconds) | |
{ |
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
#!/bin/bash | |
# Settings | |
PORT=30000 | |
TIMEOUT=2000 | |
NODES=3 | |
REPLICAS=2 | |
# You may want to put the above config parameters into config.sh in order to | |
# override the defaults without modifying this script. |
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
// Explicitly save/update a url parameter using HTML5's replaceState(). | |
function updateQueryStringParam(param, value) { | |
baseUrl = [location.protocol, '//', location.host, location.pathname].join(''); | |
urlQueryString = document.location.search; | |
var newParam = key + '=' + value, | |
params = '?' + newParam; | |
// If the "search" string exists, then build params from it | |
if (urlQueryString) { | |
keyRegex = new RegExp('([\?&])' + 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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Return a Collection of Objects | |
|-------------------------------------------------------------------------- | |
*/ | |
// collection of all users | |
$sql = "select * from users"; |
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
// takes the form field value and returns true on valid number | |
function valid_credit_card(value) { | |
// accept only digits, dashes or spaces | |
if (/[^0-9-\s]+/.test(value)) return false; | |
// The Luhn Algorithm. It's so pretty. | |
var nCheck = 0, nDigit = 0, bEven = false; | |
value = value.replace(/\D/g, ""); | |
for (var n = value.length - 1; n >= 0; n--) { |
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
function scrollTo(element, to, duration) { | |
if (duration < 0) return; | |
var difference = to - element.scrollTop; | |
var perTick = difference / duration * 2; | |
setTimeout(function() { | |
element.scrollTop = element.scrollTop + perTick; | |
scrollTo(element, to, duration - 2); | |
}, 10); | |
} |
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
// Object.create | |
Object.create = function create(prototype, properties) { | |
var | |
isFunction = typeof prototype === 'function', | |
name = isFunction && Function.prototype.toString.call(prototype).match(/^function\s+(\w*)/)[1] || 'Object', | |
object; | |
if (!isFunction && typeof prototype !== 'object') { | |
throw new Error('Object prototype may only be an Object or null'); | |
} |
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
(function () { | |
var | |
documentElement = document.documentElement, | |
viewportFontSize, viewportHeight, viewportIsPortrait, viewportMax, viewportMin, viewportWidth; | |
function getViewportFontSize() { | |
var | |
body = documentElement.appendChild(document.createElement('body')), | |
iframe = document.createElement('iframe'), | |
iframeDocument; |