Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Code wins arguments

Alexander frontenddeveloping

:octocat:
Code wins arguments
View GitHub Profile
@frontenddeveloping
frontenddeveloping / patch-android-studio-check.js
Created Oct 14, 2018 — forked from joeljeske/patch-android-studio-check.js
Fixes android plugin install that fail because it cannot find AndroidManifest.xml
View patch-android-studio-check.js
/**
* This hook overrides a function check at runtime. Currently, cordova-android 7+ incorrectly detects that we are using
* an eclipse style project. This causes a lot of plugins to fail at install time due to paths actually being setup
* for an Android Studio project. Some plugins choose to install things into 'platforms/android/libs' which makes
* this original function assume it is an ecplise project.
*/
module.exports = function(context) {
if (context.opts.cordova.platforms.indexOf('android') < 0) {
return;
}
View index.html
<!doctype html public>
<meta charset="utf-8"/>
<title>HTML with venderPackages.dll.js</title>
<body>
<div id="root"></div>
<!-- node_modules/PROJECT-NAME-TEMP-FOLDERNAME-dll/vendorPackages.dll.js generated by postinstall.js running webpack with webpack.dll.config.js -->
<script src="/vendorPackages.dll.js"></script>
<script src="/__build__/bundle.js"></script>
</body>
</html>
View simple-pagination.js
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
View mocha-runner.js
import fs from 'fs';
import path, { resolve } from 'path';
import assert from 'assert';
import Module from 'module';
import jsdom from 'jsdom';
import Mocha from 'mocha';
import chokidar from 'chokidar';
// Let's import and globalize testing tools so
// there's no need to require them in each test
@frontenddeveloping
frontenddeveloping / js-micro.js
Created May 17, 2016 — forked from yuval-a/js-micro.js
Javascript micro-optimizations
View js-micro.js
// Array literal (= []) is faster than Array constructor (new Array())
// http://jsperf.com/new-array-vs-literal/15
var array = [];
// Object literal (={}) is faster than Object constructor (new Object())
// http://jsperf.com/new-array-vs-literal/26
var obj = {};
// property === undefined is faster than hasOwnProperty(property)
// http://jsperf.com/hasownproperty-vs-in-vs-undefined/17
@frontenddeveloping
frontenddeveloping / Opinion.md
Created Apr 7, 2016 — forked from ALF-er/Opinion.md
ReactJS Conf 2016
View Opinion.md

Disclaimer 1: Первую которая "про то чего мы достигли" я таки пропустил.

Disclaimer 2: Многие доклады смотрелись и отчёты писались в состоянии алкогольного опьянения.

1. Ben Alpert - What Lies Ahead

Сейчас посмотрел Ben Alpert - What Lies Ahead она про то какие идеи они имеют о дальнейшем развитии. И они делят на UX-идеи и DX-идеи. В UX у них:

@frontenddeveloping
frontenddeveloping / Fix Cygwin Issues with Ruby
Created Mar 15, 2016 — forked from mztriz/Fix Cygwin Issues with Ruby
No such file or directory — /cygdrive/c/Ruby193/bin/gem (LoadError)
View Fix Cygwin Issues with Ruby
Add the following to your .bashrc (change path as necessary):
alias ruby='/cygdrive/c/Ruby193/bin/ruby'
alias gem='/cygdrive/c/Ruby193/bin/gem.bat'
alias irb='/cygdrive/c/Ruby193/bin/irb.bat'
@frontenddeveloping
frontenddeveloping / gitclean.sh
Created Feb 15, 2016 — forked from ericelliott/gitclean.sh
gitclean.sh - cleans merged/stale branches from origin
View gitclean.sh
git remote prune origin
git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin
View jquery.leaks.js
/**
* Watcher leaks for jQuery
* RubaXa <trash@rubaxa.org>
* MIT Licensed.
*
* API:
* $.leaks.get();
* $.leaks.watch();
* $.leaks.unwatch();
* $.leaks.remove();