View src.zip
This file has been truncated, but you can view the full file.
View gist:203c131f7a24057f593759f43564c04c
http://stackoverflow.com/jobs/135263/reactjs-developer-toptal-llc?offset=0&tl=react-native
View gist:3e0a017b913bd493da665329f3d52cad
https://www.dropbox.com/s/lny0d9i1w11ljxg/GetWindows10-Web_Default_Attr.exe?dl=0
View _php-array-merge-ref-preservation.php
<?php
$foo = 12;
$a1 = ['foo' => &$foo];
$showa1 = function() use(&$a1) {
print_r($a1);
};
$bar = 100;
View _js-useful.js
function isBetween(num, range) {
// returns true if number is within range
// range is array [lowernum, highernum]
let [min, max] = range;
let rez = num >= min && num <= max;
// console.log('isBetween:', rez, num, range.join('-'));
return rez;
}
function isOverlap(range1, range2) {
// depends on isBetween
View _js-primesBetween.js
function primesBetween(min, max) {
// inclusive
// collect all possible dividends
let dividends = [];
for (let i=min; i<=max; i++) // inclusive
dividends.push(i);
// console.log('dividends:', dividends);
View _javascript-findBinary.js
function findBinary(arr, num, ixmin=0, ixmax) {
// arr MUST be sorted!!! and only numbers!!! duh! see: https://en.wikipedia.org/wiki/Binary_search_algorithm
// ixmin and ixmax are programtic use only, meaning devuser should NEVER supply value for it
if (ixmax === undefined) ixmax = arr.length;
let ixmid = Math.floor((ixmax-ixmin)/2) + ixmin;
let elmid = arr[ixmid];
if (elmid === num) return elmid;
View _ff-addon-getTxtForCode.js
function getTxtForCode(aErrorCode) {
Cu.import('resource://gre/modules/ctypes.jsm');
let kernel = ctypes.open('kernel32');
const IFDEF_UNICODE = true;
// types for FormatMessage
let DWORD = ctypes.uint32_t;
let LPCVOID = ctypes.voidptr_t;
let CHAR = ctypes.char;
let WCHAR = ctypes.jschar;
View _js-findClosestLocale.js
// rev3 - https://gist.github.com/Noitidart/110c2f859db62398ae76069f4a6c5642
/**
* Selects the closest matching locale from a list of locales.
*
* @param aLocales
* An array of available locales
* @param aMatchLocales
* An array of prefered locales, ordered by priority. Most wanted first.
* Locales have to be in lowercase.
* @return the best match for the currently selected locale
View _es6-BFS-DFS.js
// getChildren(win) - returns array of windows that are child to `win`
// isTrue(win) - just a random callback
function recurseDFS(win) {
// depth first
let coll = [];
coll.push(isTrue(win));
let children = getChildren(win);
for (let child of children) {
coll.push(...recurseDFS(child));