Skip to content

Instantly share code, notes, and snippets.

@adamalbrecht
adamalbrecht / keybase.md
Created June 15, 2020 13:55
Keybase Proof

Keybase proof

I hereby claim:

  • I am adamalbrecht on github.
  • I am adamalbrecht (https://keybase.io/adamalbrecht) on keybase.
  • I have a public key ASAH-RXPL5zjhav1D1o_rh7KU0QLq0wXhXisIDk1C6W9QQo

To claim this, I am signing this object:

let blacklists = [
"*://mail.google.com/*",
"*://inbox.google.com/*",
"*://twitter.com/*"
]
map "ctrl+l" nextTab
map "ctrl+h" previousTab
set preventdefaultesc

Keybase proof

I hereby claim:

  • I am adamalbrecht on github.
  • I am adamalbrecht (https://keybase.io/adamalbrecht) on keybase.
  • I have a public key whose fingerprint is FCEF 46E7 E551 70F2 CE7F 470F E765 E448 13AA BF38

To claim this, I am signing this object:

@adamalbrecht
adamalbrecht / coffeescript_rest_api_wrappers.coffee
Last active August 29, 2015 13:57
Simplified CoffeeScript wrappers for my REST API.
class BaseAPI
constructor: (@route, @options={}) ->
# Some extra logic based on @options. Mine involves setting up optional parent routes for nested resources.
getList: (params={}) ->
# GET request using @route and the params. Returns a promise.
get: (id, params={}) ->
# GET request using @route, id and params. Returns a promise.
#!/usr/bin/env bash
sudo apt-get -y update
sudo apt-get -y install build-essential libyaml-dev zlib1g-dev openssl libssl-dev libreadline6-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
sudo ./configure --prefix=/usr/local
sudo make
sudo make install
@adamalbrecht
adamalbrecht / ngDebounce.js
Last active December 9, 2022 20:16
Simple debounce function for Angular.js found at the link below and slightly tweaked. http://plnkr.co/edit/fJwRER?p=info
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
angular.module('ngDebounce', []).factory('$debounce', function($timeout, $q) {
return function(func, wait, immediate) {
var timeout;
var deferred = $q.defer();
return function() {
var context = this, args = arguments;
$(document).ready(function(){
// .loading is a div at the bottom of the screen. Only display if there are additional records able to be loaded
if ($('.loading').length > 0) {
$(window).scroll(function() {
if ($(window).scrollTop() > $(document).height() - $(window).height() - 50) {
$('.loading').text("Loading more products")
// Fetch more records by pulling either JSON or straight HTML from the server
// Set the html for these records to a variable called additionalRecordsHtml
$('.results').append(additionalRecordsHtml)
}
@adamalbrecht
adamalbrecht / hack.sh
Created April 1, 2012 00:31 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#