https://github.com/pulls?user=matrix-hacks replace matrix-hacks with your own
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
/** | |
* Creates a read/writable property which returns a function set for write/set (assignment) | |
* and read/get access on a variable | |
* | |
* @param {Any} value initial value of the property | |
*/ | |
function createProperty(value) { | |
var _value = value; | |
/** |
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
;;; runs eslint --fix on the current file after save | |
;;; alpha quality -- use at your own risk | |
(defun eslint-fix-file () | |
(interactive) | |
(message "eslint --fixing the file" (buffer-file-name)) | |
(shell-command (concat "eslint --fix " (buffer-file-name)))) | |
(defun eslint-fix-file-and-revert () | |
(interactive) |
Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.
All files were downloaded from https://cdnjs.com and named accordingly.
Output from ls
command is stripped out (irrelevant stuff)
$ ls -lhS
566K Jan 4 22:03 angular2.min.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
/* | |
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets. | |
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there). | |
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ . | |
Known limitations: | |
- it won't be able to take into account some external stylesheets (if CORS isn't set up) | |
- it will produce false negatives for classes that are mentioned in the comments. |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
#### Default Configuration | |
CONCURRENCY=4 | |
REQUESTS=100 | |
ADDRESS="http://localhost:8080/" | |
show_help() { | |
cat << EOF |
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
// assertions/compareScreenshot.js | |
var resemble = require('resemble'), | |
fs = require('fs'); | |
exports.assertion = function(filename, expected) { | |
var screenshotPath = 'test/screenshots/', | |
baselinePath = screenshotPath + 'baseline/' + filename, | |
resultPath = screenshotPath + 'results/' + filename, | |
diffPath = screenshotPath + 'diffs/' + filename; |
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 ruby | |
require 'socket' | |
# This script runs every minute, captures stats about redis | |
# and forwards them to graphite as counter values. | |
# Graphite/carbon settings | |
GRAPHITE_HOST="graphite.intra.local.ch" | |
GRAPHITE_PORT=8125 |
NewerOlder