Skip to content

Instantly share code, notes, and snippets.

View jakebellacera's full-sized avatar

Jake Bellacera jakebellacera

View GitHub Profile
@JohnAlbin
JohnAlbin / _README.md
Last active March 18, 2024 09:25 — forked from clarkdave/createPages.ts
TypeScript + Gatsby config and node API

README

  1. When Gatsby starts up, it will read gatsby-config.js first.
  2. As you can see below, we use that file to require('ts-node').register() which registers a TypeScript evaluator that will be used when Gatsby reads all other API Javascript files. In other words, we only need to do this once in our entire codebase and not in other Gatsby files like gatsby-node.js.
  3. Our gatsby-config.js re-exports all the exported variables available in gatsby-config.ts.
@jtsternberg
jtsternberg / cmb-select-with-optgroups.php
Last active November 15, 2017 20:38
CMB2 select field options overridden with a filter and using optgroups
<?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 February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
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/
// 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 April 19, 2024 11:00
OS X Screencast to animated GIF

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 October 13, 2012 02:32
A paginator plugin built with Prototype.js - http://github.com/jakebellacera/paginator

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 September 16, 2012 17:32
Improved webkit inspector toolbar
#-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 August 22, 2012 20:29
Instructions on how to use MAMP with the mysql2 gem and Ruby 1.9.3-p194 via rbenv

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 June 30, 2012 21:03
Creating and Deploying an EdgeRails (Rails 4) Application to Heroku
# 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
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 23, 2024 15:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname