Skip to content

Instantly share code, notes, and snippets.

View megatolya's full-sized avatar

Anatoly Ostrovsky megatolya

View GitHub Profile
@zshell31
zshell31 / react-native-pinch-zoom.js
Created September 19, 2016 13:32
React Native: how to implement pinch to zoom gesture
/** Links:
* - http://stackoverflow.com/questions/36368919/scrollable-image-with-pinch-to-zoom
* - http://blog.lum.pe/gesture-detection-in-react-native-fixing-unexpected-panning/
*
*/
import React, {Component, PropTypes} from 'react';
import { Text, View, PanResponder, Image } from 'react-native';
function calcDistance(x1, y1, x2, y2) {
@morganrallen
morganrallen / _README.md
Last active January 15, 2023 19:41
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@Noitidart
Noitidart / _template-BootstrapJSM.xpi
Last active July 22, 2018 03:30
ff-addon-template: Template for how to create a JSM module.
@RubaXa
RubaXa / jquery.fn.find.js
Last active April 14, 2016 15:47
Fastest jQuery.fn.find
/**
* Fastest jQuery.fn.find
* @jsperf http://jsperf.com/jquery-find-vs-jquery-fastestfind
* @author RubaXa <ibnRubaXa@gmail.com>
* @license MIT
*/
/* global document, jQuery */
document.createElement('div').querySelectorAll && (function ($, originalFind){
/**
* Watcher leaks for jQuery
* RubaXa <trash@rubaxa.org>
* MIT Licensed.
*
* API:
* $.leaks.get();
* $.leaks.watch();
* $.leaks.unwatch();
* $.leaks.remove();
@aseabridge
aseabridge / obj-inspector.js
Created October 17, 2012 17:24
Javascript object inspector
function simpleObjInspect(oObj, key, tabLvl)
{
key = key || "";
tabLvl = tabLvl || 1;
var tabs = "";
for(var i = 1; i < tabLvl; i++){
tabs += "\t";
}
var keyTypeStr = " (" + typeof key + ")";
if (tabLvl == 1) {
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ryanflorence
ryanflorence / static_server.js
Last active March 13, 2024 08:05
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);