Skip to content

Instantly share code, notes, and snippets.

View gbertb's full-sized avatar

Gilbert Bagaoisan gbertb

View GitHub Profile
@gbertb
gbertb / rails_resources.md
Created October 29, 2013 18:36 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@gbertb
gbertb / css_resources.md
Created October 29, 2013 18:36 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@gbertb
gbertb / backup.sh
Created November 9, 2013 05:24
Backup all MySQL Databases on one Host
#!/bin/sh
PWD=`which pwd`
MYSQLDUMP=`which mysqldump`
MYSQL=`which mysql`
TAR=`which tar`
HOST=localhost
USER=root
PASS=password
@gbertb
gbertb / .profile
Created November 9, 2013 08:36 — forked from webdevwilson/.profile
# overload cd to gc git when entering a directory
cd () {
builtin cd "$@"
if [ -d ".git" ]; then
(git gc --quiet &)
fi
}
@gbertb
gbertb / index.htm
Created November 11, 2013 04:12 — forked from jonhkr/custom.js
Bootstrap modal + ladda btn loader
<a href="/url/to/load/modal_window.htm"
data-toggle="modal"
data-target="#"
data-style="zoom-out"
class='ladda-button btn'>
<span class='ladda-label'>link</span>
</a>

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 / font-awesome.js
Created March 12, 2014 06:40
How to load Font Awesome asynchronously
<!--
How to load Font Awesome asynchronously
Use: Just put this script on the bottom/footer of your web
-->
<script type="text/javascript">
(function() {
var css = document.createElement('link');
css.href = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css';
@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/