Skip to content

Instantly share code, notes, and snippets.

View xxllexx's full-sized avatar

Alex Kovalenko xxllexx

  • Wix
  • Dnipro, Ukraine
View GitHub Profile
import UIKit
class ViewController: UIViewController {
var isFirst = true
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
@xxllexx
xxllexx / clamp.js
Last active January 8, 2017 06:53
Clump Rich Text
var TEXT_NODE = 3;
var ELEMENT_NODE = 1;
var ENOUGH = 0;
var TOO_MUCH = 1;
var NOT_ENOUGH = -1;
var splitBy = ['.', '-', '–', '—', ' '];
var cleanupElementsList = ['br', 'img', 'video', 'audio', 'hr'];
var clampSymbol = '... [Read More]';
function computeStyle(elem, prop) {
@xxllexx
xxllexx / fn.js
Last active September 15, 2016 07:06
scheme reader
import _ from 'lodash';
const morf = {
'array': (source, scheme) => source.map(i => scheme ? getDataByScheme(scheme, i) : i),
'object': (source, scheme) => scheme ? getDataByScheme(scheme, source) : _.deepClone(source),
'enumObject': (source, scheme) => scheme ? _.keys(source).reduce((a, i) => (a[i] = getDataByScheme(scheme, source[i]), a), {}): _.deepClone(source),
'identity': source => source
};
const getDataByScheme = (scheme, source) => _.keys(scheme).reduce((acc, prop) => ((prop in source) &&
--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0