Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
barneycarroll / README.md
Last active May 28, 2025 02:19
Lock and unlock a page's scroll position.

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa
@nuttt
nuttt / boo.cpp
Last active December 19, 2015 21:29
boo's c++
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
vector<pair< int, pair<int,int> > > elephant;
@johnmegahan
johnmegahan / functions.php
Created January 12, 2012 01:50
Extended Walker class for use with the Twitter Bootstrap toolkit Dropdown menus in Wordpress.
<?php
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
add_action( 'init', 'register_menu' );