Skip to content

Instantly share code, notes, and snippets.

View frontenddeveloping's full-sized avatar
:octocat:
Code wins arguments

Alexander frontenddeveloping

:octocat:
Code wins arguments
View GitHub Profile
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
<head>
<meta charset='utf-8'/>
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@frontenddeveloping
frontenddeveloping / patch-android-studio-check.js
Created October 14, 2018 04:07 — forked from joeljeske/patch-android-studio-check.js
Fixes android plugin install that fail because it cannot find AndroidManifest.xml
/**
* 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;
}
<!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>
@frontenddeveloping
frontenddeveloping / simple-pagination.js
Created July 27, 2016 07:46 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
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 19:55 — forked from yuval-a/js-micro.js
Javascript micro-optimizations
// 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
const PENDING_STATE = 'pending';
const REJECTED_STATE = 'rejected';
const RESOLVED_STATE = 'resolved';
class Deferred {
static PENDING_STATE = PENDING_STATE;
static REJECTED_STATE = REJECTED_STATE;
static RESOLVED_STATE = RESOLVED_STATE;
constructor() {
let state = PENDING_STATE;
@frontenddeveloping
frontenddeveloping / Opinion.md
Created April 7, 2016 09:46 — forked from ALF-er/Opinion.md
ReactJS Conf 2016

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

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

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

@frontenddeveloping
frontenddeveloping / devtools-perf-annotations-example.js
Created March 31, 2016 07:39
DevTools Perdomance annotation example
//@DevToolsPerfTest('my_super_fast_code')
Array(1e6).fill(1).map(() => Math.random())
//@DevToolsPerfTestEnd('my_super_fast_code', 5)
// if my code runs more than 5ms I want to get warining in console.
@frontenddeveloping
frontenddeveloping / Fix Cygwin Issues with Ruby
Created March 15, 2016 13:39 — forked from mztriz/Fix Cygwin Issues with Ruby
No such file or directory — /cygdrive/c/Ruby193/bin/gem (LoadError)
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'