Skip to content

Instantly share code, notes, and snippets.

View ohall's full-sized avatar
🚀

Oakley Hall ohall

🚀
View GitHub Profile

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
// thanks to @raganwald
function spread(fn) {
return Function.apply.bind( fn, null );
}
function foo(x,y,z) {
console.log(x,y,z);
}
function bar(fn) {
@ohall
ohall / makeGlobal.md
Last active August 29, 2015 14:14
Use a shell script as a global command OSX

##Make a shell script into a global command on OSX.

####This example will open app passed as param in TextMate

1 Create your script in /usr/local/bin on OSX, it will automatically be added to your $PATH

/usr/local/bin/tm.sh

2 Make script executable

@ohall
ohall / smoothScrolling.md
Created January 27, 2015 21:50
Performs a smooth page scroll to an anchor on the same page.

##Smooth Scrolling Performs a smooth page scroll to an anchor on the same page.

$(function() {
  $('a[href*=#]:not([href=#])').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
 if (target.length) {
@ohall
ohall / wsserver.sh
Created January 27, 2015 14:54
Check who's clobbering WebStorm server
lsof -i TCP:63342
@ohall
ohall / npmmine.sh
Last active August 29, 2015 14:11
Reclaim ownership of NPM modules
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
@ohall
ohall / killer.sh
Created December 4, 2014 14:52
Find and kill process by port
lsof -i :9000 #or whatever port
kill -9 pID
@ohall
ohall / deleteBranch.sh
Last active August 29, 2015 14:10
Delete a branch from# git
#!/bin/sh
if [ -z $1 ];
then
echo 'USAGE: specify a branch to delete'
else
#delete a local branch
git branch -d $1
#delete a remote branch
@ohall
ohall / models.js
Created November 19, 2014 22:35
a Backbone model with callbacks
models.OrgsModel = Backbone.Model.extend({
url: function() {
return root + 'organizations.json';
},
behavior: function (org) {
loc.org = org;
utils.nav(org);
},
defaultItem: function () {
return loc.org;
@ohall
ohall / simple.html
Created November 19, 2014 22:29
A very simple BackboneJS view with model http://jsfiddle.net/oakley349/ate0Lpos/4/
<style>
#rootEl {
color:#FFFFFF;
text-align:center;
height:50px;
width:150px;
background-color:red;
}
</style>
<div id="rootEl"><h3>Click Me</h3></div>