Skip to content

Instantly share code, notes, and snippets.

@megamaddu
megamaddu / scroll-manager.js
Last active May 9, 2021 14:17
Scroll Manager for React Router v4
import React from 'react'
import { func, node, number, object, shape, string } from 'prop-types'
import { withRouter } from 'react-router'
import debounceFn from 'lodash/debounce'
class ScrollManager extends React.Component {
static propTypes = {
children: node.isRequired,
history: shape({
action: string.isRequired,
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
/*
*
* Mongo-Hacker
* MongoDB Shell Enhancements for Hackers
*
* Tyler J. Brock - 2013
*
* http://tylerbrock.github.com/mongo-hacker
*
*/
@yanatan16
yanatan16 / .mongorc.js
Last active June 27, 2022 09:03
My .mongorc.js file
(function () {
rcversion = '1.0';
load('underscore.min.js')
// NOTES
// Basics, wrap the whole thing in a function
// Set a version for sanity's sake
// Load underscore, a must in any javascript environment
@jkresner
jkresner / test-passport.coffee
Created June 20, 2013 17:50
Passport.js user mocking version 2
users = require './../data/users'
data = users: []
data.users.anon = authenticated: false
data.users.admin = users[0]
data.users.jk = users[1]
data.users.artle = users[5]
data.users.beountain = users[4]
setSession = (userKey) ->
@middlesister
middlesister / childtheme_separate_options.php
Last active December 17, 2015 05:49
Add child theme settings to Thematic theme options page
<?php
add_action ('admin_init', 'childtheme_opt_init');
/**
* Add childtheme settings to the thematic theme
*
* This will create a separate setting in the database, but
* add the settings to the existing theme options page in Thematic
**/
function childtheme_opt_init() {