Skip to content

Instantly share code, notes, and snippets.

View gbertb's full-sized avatar

Gilbert Bagaoisan gbertb

  • San Francisco, CA
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.
If you get this when trying to connect to PG
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
A pid file was blocking postgres from starting up. To fix it:
rm /usr/local/var/postgres/postmaster.pid
@gbertb
gbertb / Step-wizard.markdown
Created October 22, 2014 02:50
A Pen by Hugo Giraudel.
#!/bin/sh
#----------------------------------------------------
# a simple mysql database backup script.
# version 2, updated March 26, 2011.
# copyright 2011 alvin alexander, http://devdaily.com
#----------------------------------------------------
# This work is licensed under a Creative Commons
# Attribution-ShareAlike 3.0 Unported License;
# see http://creativecommons.org/licenses/by-sa/3.0/
@gbertb
gbertb / Default (OSX).sublime-keymap
Created October 15, 2012 22:10 — forked from stilist/Default (OSX).sublime-keymap
Sublime Text 2 preferences
[
// Drawn from http://www.sublimetext.com/forum/viewtopic.php?f=2&t=7477#p31755
// Kills the annoying default of cmd-left jumping to the start of a line's
// code, rather than column 0.
{ "keys": ["super+left"], "command": "move_to", "args": {"to": "hardbol", "extend": false} },
{ "keys": ["super+right"], "command": "move_to", "args": {"to": "hardeol", "extend": false} }
]
/*********************************************************************
* #### Twitter Post Fetcher v7.0 ####
* Coded by Jason Mayes 2013. A present to all the developers out there.
* www.jasonmayes.com
* Please keep this disclaimer with my code if you use it. Thanks. :-)
* Got feedback or questions, ask here:
* http://www.jasonmayes.com/projects/twitterApi/
* Updates will be posted to this site.
*********************************************************************/
var twitterFetcher=function(){function t(d){return d.replace(/<b[^>]*>(.*?)<\/b>/gi,function(c,d){return d}).replace(/class=".*?"|data-query-source=".*?"|dir=".*?"|rel=".*?"/gi,"")}function m(d,c){for(var f=[],e=RegExp("(^| )"+c+"( |$)"),g=d.getElementsByTagName("*"),b=0,a=g.length;b<a;b++)e.test(g[b].className)&&f.push(g[b]);return f}var u="",j=20,n=!0,h=[],p=!1,k=!0,l=!0,q=null,r=!0;return{fetch:function(d,c,f,e,g,b,a){void 0===f&&(f=20);void 0===e&&(n=!0);void 0===g&&(g=!0);void 0===b&&(b=!0);
@gbertb
gbertb / gradient-line.html
Created July 17, 2013 20:13
gradient horizontal line
hr {
border: none;
border-top: 1px solid #eee;
height: 5px;
background: -webkit-radial-gradient(50% 0%, 50% 5px, #aaa 0%, white 100%);
}
@gbertb
gbertb / multiple_ssh_setting.md
Created September 6, 2013 05:59 — forked from jexchan/multiple_ssh_setting.md
Good way to use multiple SSH for github

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
<?php
/**
* Usage:
* Send the url you want to access url encoded in the url paramater, for example (This is with JS):
* /twitter-proxy.php?url='+encodeURIComponent('statuses/user_timeline.json?screen_name=MikeRogers0&count=2')
*/
// The tokens, keys and secrets from the app you created at https://dev.twitter.com/apps
$config = array(
@gbertb
gbertb / new_gist_file
Created September 18, 2013 07:21
copy message urls in apple mail
tell application "Mail"
set _sel to get selection
set _links to {}
repeat with _msg in _sel
set _messageURL to "message://%3c" & _msg's message id & "%3e"
set end of _links to _messageURL
end repeat
set AppleScript's text item delimiters to return
set the clipboard to (_links as string)
end tell