Skip to content

Instantly share code, notes, and snippets.

Avatar
👤
Committing

Ahmid snuggs

👤
Committing
View GitHub Profile
View termux.properties
# Beep with a sound.
bell-character=beep
# Vibrate device (default).
bell-character=vibrate
extra-keys = [ \
['DRAWER','KEYBOARD','TAB','LEFT','UP','DOWN','RIGHT','BKSP','DEL'] \
]
#['DRAWER','ESC','CTRL','ALT','HOME','END','PGDN','PGUP'], \
@snuggs
snuggs / .bash_aliases
Last active Apr 11, 2021
.bashrc Configuration File
View .bash_aliases
# ----------------------
# Aliases
# ----------------------
# ----------------------
# Postgresql Aliases
# ----------------------
alias start_postgres="~/start_postgresql"
@snuggs
snuggs / speedshop.md
Created May 8, 2017 — forked from nateberkopec/speedshop.md
Speedshop Contract
View speedshop.md

This is a Services Agreement between The Speedshop Ltd. Co. (“we,” “us,” “our”) and any individual, entity, or organization that procures our services (“you” or “your”).

  1. Acceptance of Terms: Any work that we do for you is governed by the terms and conditions that you’re reading now. If you don’t agree to them, we can’t provide you with any services. This agreement is a binding contract between you and The Speedshop.
  2. Terms May Change: Periodically, we may change the terms and conditions in this agreement, including the amount of our fees. If we do change any of these terms, they’ll take effect for you the next time that you contract for our services. Any work that we’ve already completed or previously initiated for you continue to be governed by the agreement in effect at the time that you contracted with us.
  3. Taxes: You are responsible for payment of all applicable sales and use taxes.
  4. Refund: If you’re genuinely dissatisfied with our services and provide us with notice within thirty (30) days of
@snuggs
snuggs / tabs.before.html
Last active Mar 12, 2017
#devPunk Pure CSS Tabs
View tabs.before.html
<!-- This doesn't work at all -->
<!-- Toggle -->
<div class="dropdown">
<a class="dropdown-inline-button" href="javascript: void(0);" data-toggle="tab"
data-target="#calibration">
<i class="dropdown-inline-button-icon icmn-database"></i>
Mostrar calibraciones
</a>
</div>
@snuggs
snuggs / mo_vs.proxy.js
Last active Nov 18, 2020 — forked from ebidel/mo_vs.proxy.js
MutationObserver vs. Proxy
View mo_vs.proxy.js
<!--
This demo shows two ways to detect changes to a DOM node `.textContent`, one
using a `MutationObserver` and the other using an ES2015 `Proxy`.
From testing, a `Proxy` appears to be 6-8x faster than using a MO in Chrome 50.
**Update**: removing the `Proxy` altogether speeds up the MO to be inline with the Proxy.
This has something to do with how the browser queues/prioritizes Proxies over MO.
@snuggs
snuggs / Gemfile
Last active Nov 18, 2020 — forked from calebwoods/Gemfile
Simple standalone ActiveRecord setup.
View Gemfile
source 'https://rubygems.org'
gem 'activerecord', '>= 4.2.0'
gem 'sqlite4'
@snuggs
snuggs / DEMETER.rb
Last active Nov 18, 2020
Law of Demeter
View DEMETER.rb
def store(model)
# 99 of 100 times we will only need to call #to_h and be done with model
persist model.to_h # Breaks demeter's law
# this usually encourages poking around in the model
# which is no concern of store
end
def store(record) #decoupled
persist record #because that's all we want to do.
# If it doesn't work as expected RTST (Read The Stack Trace)
@snuggs
snuggs / metaprogramming_for_dummies.rb
Created Mar 24, 2011
Meta Programming Made Easy
View metaprogramming_for_dummies.rb
# Yehuda Katz - (It's all about the self)
# http://yehudakatz.com/2009/11/15/metaprogramming-in-ruby-its-all-about-the-self/
#######################################################################################
# All classes are objects themselves
#######################################################################################
# Defining a class using the "class" keyword is merely syntactic sugar.
# All class definitions are actually instances of the Class object.
@snuggs
snuggs / .tmux.conf
Last active Nov 19, 2020
IDE & TMUX Configuration
View .tmux.conf
############################################################################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
# Cheatsheets:
# https://devhints.io/tmux
# `property not found` issue:
@snuggs
snuggs / .vimrc
Last active Apr 4, 2021
VIM "$ mkdir ~/.tmp # ensure directory exists first
View .vimrc
set encoding=utf-8
" Author: Ahmid-Ra (github.com/snuggs)
" Screencasts: http://vimcasts.org
" Gist: https://gist.github.com/snuggs/612093
" Tutorial: http://learnvimscriptthehardway.stevelosh.com