Skip to content

Instantly share code, notes, and snippets.

@ohmyhusky
ohmyhusky / sroll_on_drag.js
Created March 21, 2017 00:09 — forked from gaearon/sroll_on_drag.js
Scroll on drag with react-dnd
configureDragDrop(registerType) {
var imageThreshold = Math.max(120, window.innerHeight / 4),
sectionThreshold = Math.max(140, window.innerHeight / 4),
currentDY = 0,
frame;
function makeScrollingHandler(threshold) {
function getScrollDY(clientY) {
var speed;
if (clientY < threshold) {
@ohmyhusky
ohmyhusky / browsersync-webpack.md
Created March 20, 2017 23:41 — forked from robinrendle/browsersync-webpack.md
Getting set up with Browsersync and Webpack

Fixing our local environment with Browsersync

Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server and BrowserSync we can fix this:

npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server

BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.

@ohmyhusky
ohmyhusky / nginx.conf
Created August 23, 2016 13:03 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@ohmyhusky
ohmyhusky / nodejs.gulp.example
Created March 29, 2016 22:16
gulp start point
var gulp = require ( 'gulp' );
var minifyCSS = require ( 'gulp-minify-css' );
var uglify = require ( 'gulp-uglify' );
var clean = require ( 'gulp-clean' );
var rename = require ( 'gulp-rename' );
var jshint = require ( 'gulp-jshint' );
var plumber = require ( 'gulp-plumber' );
var sass = require ( 'gulp-sass' );
var autoprefixer = require ( 'gulp-autoprefixer' );
var concat = require ( 'gulp-concat' );