Skip to content

Instantly share code, notes, and snippets.

View ftsanjuan's full-sized avatar

Francis San Juan ftsanjuan

View GitHub Profile
@ftsanjuan
ftsanjuan / mongo.conf
Created October 10, 2014 18:58
A MongoDB config file in YAML format for installations on Mac OSX using Homebrew. Start up mongo daemon process with: mongod --config path/to/mongo.conf
# daemonize by default
processManagement:
fork: true
systemLog:
destination: file
path: "/usr/local/var/log/mongodb/mongo.log"
logAppend: true
# Only accept local connections
@ftsanjuan
ftsanjuan / Gruntfile.js
Created June 27, 2014 14:27
A base Angular.js app Gruntfile with sass, uglify and watch.
module.exports = function(grunt) {
grunt.initConfig({
// concatenates all your js files
concat: {
js: {
src: ['app/app.js', 'app/js/**/**.js'],
dest: 'tmp/app.js'
}
},
// minifies your js files
@ftsanjuan
ftsanjuan / string.rb
Created May 15, 2014 16:58
Ruby String Extensions
# Extensions to the String class
class String
# converts a string to a symbol with spaces converted to underscores
def symbolize
self.downcase.gsub(/[^0-9A-Za-z ]/, '').gsub(" ", "_").to_sym
end
# converts a string to a machine-safe version
def machinize
self.downcase.gsub(/[^0-9A-Za-z ]/, '').gsub(" ", "_")
@ftsanjuan
ftsanjuan / Gruntfile.js
Created February 27, 2014 15:44
A base Gruntfile and package.json setup that minifies js files, compiles sass files and sets up watch on a base folder (app/)
module.exports = function(grunt) {
grunt.initConfig({
// concatenates all your js files
concat: {
js: {
src: ['app/app.js', 'app/js/**/**.js'],
dest: 'tmp/app.js'
}
},
// minifies your js files
@ftsanjuan
ftsanjuan / responsify.scss
Created August 19, 2013 20:50
A SASS mixin to help generate responsive media query styles. Responsive breakpoints are based on Twitter Bootstrap 2 breakpoints.
/**
* Creates responsive media query styles for a particular media size
* Media type codes are: phone, subtablet, tablet, desktop, large-desktop
*
* Example usage:
*
* .header {
* @include responsify(phone) {
* width: 200px;
* }
@ftsanjuan
ftsanjuan / php-arr-provinces-ca-en.php
Last active February 9, 2021 14:21
A PHP array of Canadian provinces (English & French)
<?php
array(
'AB' => "Alberta",
'BC' => "British Columbia",
'MB' => "Manitoba",
'NB' => "New Brunswick",
'NL' => "Newfoundland",
'NT' => "Northwest Territories",
'NS' => "Nova Scotia",
'NU' => "Nunavut",
// à la http://flatuicolors.com
// greens
$turquoise: #1abc9c;
$greensea: #16a085;
$emerald: #2ecc71;
$nephritis: #27ae60;
// yellows/oranges/reds
$sunflower: #f1c40f;