Skip to content

Instantly share code, notes, and snippets.

View livimonte's full-sized avatar
:octocat:

Livingstone Del Monte livimonte

:octocat:
View GitHub Profile
@livimonte
livimonte / Debouncer.js
Created January 3, 2013 18:38
Event debouncer control.
var debouncer = function (func, pTimeout) {
var timeoutID, timeout = pTimeout || 200;
return function() {
var scope = this, args = arguments;
clearTimeout(timeoutID);
timeoutID = setTimeout(function() {
func.apply(scope, Array.prototype.slice.call(args));
}, timeout);
};
};
@livimonte
livimonte / box-min-height-100.html
Last active March 28, 2022 23:30
Take 100% height of inner div with min-height in the container. Crossbrowser, only html and css.
<!DOCTYPE html>
<head>
<style>
.main {
overflow:hidden;
border:#000 1px solid;
width:450px;
position: relative;
min-height: 50px;
//<a href="#home" class="scroll">Home</a>
$(".scroll").click(function(event){
event.preventDefault();
var full_url = this.href
, parts = full_url.split("#")
, trgt = parts[1]
, target_offset = $("#"+trgt).offset()
, target_top = target_offset.top;
#!/bin/bash
brew_command=/usr/local/bin/brew
brew_cask_command="$brew_command cask"
echo '#!/bin/bash'
echo ''
echo 'trap ctrl_c INT'
echo 'function ctrl_c() {'
echo 'echo "** Trapped CTRL-C"'