Skip to content

Instantly share code, notes, and snippets.

Jake Bellacera jakebellacera

Block or report user

Report or block jakebellacera

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jtsternberg
jtsternberg / cmb-select-with-optgroups.php
Last active Nov 15, 2017
CMB2 select field options overridden with a filter and using optgroups
View cmb-select-with-optgroups.php
<?php
function cmb_opt_groups( $args, $defaults, $field_object, $field_types_object ) {
// Only do this for the field we want (vs all select fields)
if ( '_cmb_option_field' != $field_types_object->_id() ) {
return $args;
}
$option_array = array(
'Group 1' => array(
@octocat
octocat / .gitignore
Created Feb 27, 2014
Some common .gitignore configurations
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@chengyin
chengyin / linkedout.js
Last active Sep 25, 2019
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
View linkedout.js
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Nov 19, 2019
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jakebellacera
jakebellacera / _readme.md
Created Oct 13, 2012
A paginator plugin built with Prototype.js - http://github.com/jakebellacera/paginator
View _readme.md

NOTE: This code now has it's own repo! Visit: http://github.com/jakebellacera/paginator


paginator.js

A lightweight paginator script. It currently uses Prototype.js, but will be framework-agnostic in future releases.

Usage

@danro
danro / Custom.css
Created Sep 16, 2012
Improved webkit inspector toolbar
View Custom.css
#-webkit-web-inspector #toolbar {
background: #cdcdcd !important;
height: 36px !important;
}
#-webkit-web-inspector #main {
top: 36px !important;
}
#-webkit-web-inspector .toolbar-item.elements:hover:after {
content: "elements";
z-index: 9999;
@jakebellacera
jakebellacera / mamp-mysql2-rbenv.md
Created Aug 22, 2012
Instructions on how to use MAMP with the mysql2 gem and Ruby 1.9.3-p194 via rbenv
View mamp-mysql2-rbenv.md

How to use MAMP with the mysql2 gem and Ruby 1.9.3-p194 via rbenv

Let's say you're a web developer who happens to work with both MAMP and Ruby when building different types of websites. Let's say you also like to keep your MySQL stuff in one place and don't like having to juggle both a local MySQL install as well as a MAMP MySQL install. Well, you can indeed connect your ruby apps to MAMP's MySQL. Here's a tutorial on how to do it.

Important! Before you do anything, download and install MAMP. MAMP Pro will work as well. At the time of this writing, MAMP 2.1.1 is the latest.

First, install Ruby via rbenv

  1. Install homebrew
  2. Install rbenv: brew install rbenv, follow any instructions homebrew gives you after the installation is complete.
@peter
peter / creating-edgerails-app.sh
Created Jun 30, 2012
Creating and Deploying an EdgeRails (Rails 4) Application to Heroku
View creating-edgerails-app.sh
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@vitaLee
vitaLee / compact_expand_css_command.py
Created Jun 3, 2012
SublimeText command for compacting/expanding CSS rules
View compact_expand_css_command.py
import sublime
import sublime_plugin
import re
class CompactExpandCssCommand(sublime_plugin.TextCommand):
def run(self, edit, action='compact'):
rule_starts = self.view.find_all('\{')
rule_ends = self.view.find_all('\}')
You can’t perform that action at this time.