Skip to content

Instantly share code, notes, and snippets.

Code wins arguments

Alexander frontenddeveloping

Code wins arguments
View GitHub Profile
frontenddeveloping / pdfjs-file-parser.js
Created Jan 18, 2016
Parse uploaded pdf file by PDF.js for number of pages and count links
View pdfjs-file-parser.js
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src=""></script>
<script src=""></script>
<link href="" rel="stylesheet" type="text/css" />
<script src=""></script>
View index.html
<!DOCTYPE html>
<html xmlns='' lang='en'>
<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 / 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())
var array = [];
// Object literal (={}) is faster than Object constructor (new Object())
var obj = {};
// property === undefined is faster than hasOwnProperty(property)
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) {
frontenddeveloping / javascript-tabs.html
Last active Feb 13, 2018
My example can open many links in tabs, not in new windows. Why need this and do not use Because there is the problem - if you call once it will open new tab or window(it depends of browser), if will call two or more times - first will open like tab/window and all next in the new window only. The individual b…
View javascript-tabs.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Open 3 tabs</title>
<script src=""></script>
<div id="hidden_div"></div>
View fetch-api-wrapper.js
(function(global) {
'use strict';
var JSON_TYPE_NAME = 'type';
function getQueryString(queryParams) {
var params = Object.keys(queryParams).map(function(paramName) {
return [paramName, encodeURIComponent(queryParams[paramName])].join('=');
return '?' + params.join('&');
frontenddeveloping /
Created Apr 7, 2016 — forked from ALF-er/
ReactJS Conf 2016

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

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

1. Ben Alpert - What Lies Ahead

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

View index.html
<!doctype html public>
<meta charset="utf-8"/>
<title>HTML with venderPackages.dll.js</title>
<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>
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 = [],
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