Skip to content

Instantly share code, notes, and snippets.

View pete-otaqui's full-sized avatar

Pete Otaqui pete-otaqui

View GitHub Profile
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active July 21, 2024 20:48
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@bobbygrace
bobbygrace / trello-css-guide.md
Last active May 15, 2024 16:01
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@joefiorini
joefiorini / Brocfile.js
Created June 12, 2014 01:42
My setup for building an Angular.js app with Broccoli & grunt
var ngMin = require('broccoli-ng-min');
var uglify = require('broccoli-uglify-js');
var compileSass = require('broccoli-ruby-sass');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var findBowerTrees = require('broccoli-bower');
var env = require('broccoli-env').getEnv();
var compileES6 = require('broccoli-es6-concatenator');
var app = 'app/scripts';
@pete-otaqui
pete-otaqui / object.spawn.js
Created May 11, 2012 09:40
Prototypal inheritance in javascript using Object.create with functions getting a "parent" property to be able to call the method they overwrote
/**
* Object.spawn for a more terse form of Object.create,
* with the super added bonus of giving all overriden
* functions a "parent" property which refers back to
* thing it was overriding ... like "parent" or "super"
* in classical OOP
*
* @link http://howtonode.org/prototypical-inheritance
@pete-otaqui
pete-otaqui / find_in_branches
Created January 12, 2012 10:37
Find File Path Pattern in all git branches
#!/bin/bash
# Authored by Pete Otaqui <pete@otaqui.com>
#
# Core code taken from StackOverflow
# http://stackoverflow.com/questions/372506/how-can-i-search-git-branches-for-a-file-or-directory
#
# The author has placed this work in the
# Public Domain, thereby relinquishing all
# copyrights. Everyone is free to use, modify,
@pete-otaqui
pete-otaqui / appendAt.jquery.js
Created October 1, 2011 20:23
jQuery plugin to append content at a specific or random index
jQuery.fn.appendAt = function( content, index ) {
this.each(function(i, item) {
var $content = $(content).clone();
if ( index === 0 ) {
$(item).prepend($content);
} else {
$content.insertAfter($(item).children().eq(index-1));
}
});
@pete-otaqui
pete-otaqui / fake_console.js
Created September 22, 2011 08:59
Fake Firebug API, allows safe use of Firebug / Web Inspector commands without breaking IE
/**
* Create a fake console api, mimicing Firebug.
*/
(function(global) {
var noop = function(){};
if ( !global['console'] ) {
global.console = {
log : noop,
debug : noop,
@pete-otaqui
pete-otaqui / env.rb
Created September 15, 2011 15:48
env.rb for cucumber ... with fixtures in a mysql database
=begin
Environment variables you can set:
MHT_HOST=domain.com ... the host to test, default is www.mangahigh.com
MHT_DRIVER='mechanize' ... default capybara driver to use, valid values are:
mechanize,
celerity,
chrome,
culerity,
selenium,
@pete-otaqui
pete-otaqui / Gemfile
Created August 11, 2011 14:32
Capybara, Cucumber, Webdriver, Mechanize and SauceLabs ... whew!
source "http://rubygems.org"
gem "cucumber"
gem "capybara"
gem "capybara-webkit", :platforms => [:ruby], :require => false, :git => "git://github.com/thoughtbot/capybara-webkit.git"
gem "capybara-mechanize", :git => "git://github.com/jeroenvandijk/capybara-mechanize.git"
gem "rspec"
gem "rake"
@mcrmfc
mcrmfc / VIM - Vertical Buffer Split
Last active September 25, 2015 06:38
VIM - My cheat sheet
search and replace
-------------------
s/foo/bar/g changes each 'foo' to 'bar' in the current line.
:%s/foo/bar/g changes each 'foo' to 'bar' in all lines.
:5,12s/foo/bar/g changes each 'foo' to 'bar' for all lines between line 5 and line 12.
:'a,'bs/foo/bar/g changes each 'foo' to 'bar' for all lines between marks a and b.
:.,$s/foo/bar/g changes each 'foo' to 'bar' for all lines between the current line (.) and the last line ($).
:.,+2s/foo/bar/g changes each 'foo' to 'bar' for the current line (.) and the two next lines (+2).
:%s is equivalent to :1,$s