Skip to content

Instantly share code, notes, and snippets.

View enesser's full-sized avatar

Eric J Nesser enesser

View GitHub Profile
@enesser
enesser / gist:9c1c43317526edcb3bc689298bfd7c3d
Created October 4, 2017 16:22 — forked from tobek/get-image-urls.js
Save images from chrome inspector network tab
/* right click on an entry in the network log, select Copy All as Har
* type in console: x = [paste]
* paste the following JS code into the console
* copy the output, paste into a file
* then wget -i [that file]
*/
(function(logObj, mime) {
var results = [];
logObj.log.entries.forEach(function (entry) {
if (mime && entry.response.content.mimeType !== mime) return;
@enesser
enesser / something.js
Created October 14, 2015 18:54 — forked from aheckmann/something.js
mongoose: emit update or create
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
mongoose.connect('localhost', 'testing_emitUpdate');
var schema = new Schema({
name: String
});
schema.pre('save', function (next) {
@enesser
enesser / GIF-Screencast-OSX.md
Last active August 31, 2015 07:49 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@enesser
enesser / main.js
Last active August 29, 2015 14:22 — forked from donnut/main.js
var mongoose = require('mongoose'),
assert = require('assert')
mongoose.connect('localhost/mydb');
var Schema = mongoose.Schema;
var ContainerSchema = new Schema({
name: String,
})
/****************************************
* GSALib Wrapper for Google Search Appliance
* GSA.Paragon.Utils
* Written by Jon Upchurch
* Copyright 2013 by Paragon Consulting, Inc.
* Free to use, distribute, and modify
* with this credit comment retained.
****************************************/
using GSALib.Constants;
using GSALib.GSA;
@enesser
enesser / Article.md
Last active August 29, 2015 14:16 — forked from Warry/Article.md

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@enesser
enesser / gulpfile.js
Last active August 29, 2015 14:08 — forked from mlouro/gulpfile.js
"use strict";
/* global console */
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('gulp-browserify');
var jshint = require('gulp-jshint');
var watch = require('gulp-watch');
var stylish = require('jshint-stylish');
var refresh = require('gulp-livereload');
var sass = require('gulp-sass');
var myEfficientFn = debounce(function() {
// All the taxing stuff you do
}, 250);
window.addEventListener('resize', myEfficientFn);