Skip to content

Instantly share code, notes, and snippets.

Avatar
🖖
dribbble.com/joeyfigaro

Joey Figaro joeyfigaro

🖖
dribbble.com/joeyfigaro
View GitHub Profile
View reddit-votebot.js
i = setInterval(function() {e = $(".up")[0]; if(e) e.onclick(); else clearInterval(i);}, 500);
@joeyfigaro
joeyfigaro / CSS-Boilerplate
Created Jun 4, 2013
CSS Reset Boilerplate
View CSS-Boilerplate
/*
Document : ${name}
Created on : ${date}, ${time}
Author : ${user}
Description:
Purpose of the stylesheet follows.
*/
/* html5doctor.com Reset Stylesheet
v1.6.1
View wordpress-admin-functions
// ========================
// = Admin Area Functions =
// ========================
require_once(TEMPLATEPATH . '/help_page.php');
// After Registration Redirect
function __my_registration_redirect()
{
return home_url( '/thank-you-for-registering' );
@joeyfigaro
joeyfigaro / pre-load-content
Created Jun 4, 2013
Pre-load Content (ala Facebook's Photo Albums)
View pre-load-content
var nextimage = "/images/some-image.jpg";
$(function(){
window.setTimeout(function(){
var img = $("<img>").attr("src", nextimage).load(function(){
//all done
});
}, 100);
});
@joeyfigaro
joeyfigaro / smooth-scrolling
Created Jun 4, 2013
Smooth scrolling for internal links
View smooth-scrolling
$('a[href^="#"]').bind('click.smoothscroll',function (e) {
e.preventDefault();
var anchor = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 500, 'swing', function () {
window.location.hash = anchor;
@joeyfigaro
joeyfigaro / sublime-preferences
Last active Dec 18, 2015
Sublime Text Preferences
View sublime-preferences
{
"auto_complete": false,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"find_select_text": true,
"fold_buttons": true,
"folder_exclude_patterns":
[
".svn",
@joeyfigaro
joeyfigaro / Config.rb
Last active Dec 25, 2015
compass config boilerplate
View Config.rb
# Note that while this file is in our config folder, it is
# symlinked to our site folders, so paths are relative from there
# Require gems and Compass plugins
# General
output_style = :compressed
relative_assets = true
project_path = File.dirname(__FILE__) + '/'
# add_import_path project_path + '../all/public/assets/styles/src/'
@joeyfigaro
joeyfigaro / iPad Dropdowns - intent detection
Last active Dec 31, 2015
Detect intent on dropdown menus for iPads. One tap shows the menu, two direct taps navigates.
View iPad Dropdowns - intent detection
// Set onclick to 'main' to make it clickable in iOS
// Docs: http://goo.gl/dshL9a
var main = document.getElementsByTagName('main')[0];
main.addEventListener('click', function() {
void(0);
});
// iPad dropdowns
// use intent to determine whether a user wants to navigate to the page or show menu
(function() {
@joeyfigaro
joeyfigaro / frontend-brandump
Last active Aug 29, 2015
Braindump for Code for RVA's playbook
View frontend-brandump
Style:
- trim excess whitespace
- two-space indentation; never tabs
- never use underscores in CSS
- use camel-casing in JS
- never abbreviate or shorten; if something is too long, revisit the language used to communicate
- never chain classes in your markup (use an abstraction layer instead... sass @extend)
- use IDs sparingly, for important parts of your document
- always ask if you actually need that container (divs especially) to accomplish what you need
- sections, asides, articles do not replace divs
@joeyfigaro
joeyfigaro / add-current-git-branch
Created Jan 14, 2015
Bash: add current git branch to prompt
View add-current-git-branch
# Highlight current git branch in green
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
}
PS1="\h:\W \u\[\033[0;32m\]\$(parse_git_branch_and_add_brackets) \[\033[0m\]\$ "