git init
Creates a new git repository in the directory
git add <file name>
Adds a specific file to staging
git add .
orgit add -A
Adds the full directory and its contents to staging
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
// ==UserScript== | |
// @name WorkflowyPlus Refac | |
// @namespace http://confusionstudios.com | |
// @version 0.2 | |
// @author Wizmann, DR2050 | |
// @match https://workflowy.com/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; |
<?php | |
/** | |
* Dirty, dirty Reddit bot: Decronym | |
*/ | |
class Reddit { | |
const USERNAME = 'Decronym'; | |
const PASSWORD = '***'; | |
const CLIENTID = '***'; | |
const SECRET = '***'; |
## Magento 1 + SampleData
sudo apt-get update && \
sudo apt-get install -y git wget unzip
git clone https://github.com/OpenMage/magento-mirror.git ./ ;
wget https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-magento-sample-data-1.9.1.0.tgz ;
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; |
This is a collection of my most often used lines of code, as well as a few other examples I want to have ready at a moment's notice. These snippets focus on building HTML from scratch, linking in good web fonts, and setting up responsive styles for your pages.
// ==UserScript== | |
// @name YouTube global shortcuts | |
// @namespace https://gist.github.com/stefansundin/ | |
// @homepage https://gist.github.com/stefansundin/65e3d6db697636d8e7f1 | |
// @downloadURL https://gist.github.com/stefansundin/65e3d6db697636d8e7f1/raw/youtube-global-shortcuts.user.js | |
// @version 1.1 | |
// @author Stefan Sundin | |
// @description Makes the YouTube shortcuts work even if the player is not focused. | |
// @icon https://www.youtube.com/favicon.ico | |
// @match https://www.youtube.com/* |
Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:
NB: Check out git subtree
/git submodule
and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.
Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.