Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Gibbons rtgibbons

View GitHub Profile
@rtgibbons
rtgibbons / logger.js
Created Apr 29, 2014
another winston logger helper
View logger.js
var winston = require('winston');
var logger = new(winston.Logger)({
transports: [
new(winston.transports.Console)({
level: 'debug',
colorize: true,
timestamp: true
}),
new winston.transports.File({
@rtgibbons
rtgibbons / userChrome.css
Created Apr 17, 2014
Using FF 29+ with Classic Theme Restorer Square Tabs (australized), updating bookmark bar to match
View userChrome.css
/* ----- BOOKMARK BUTTONS ----- */
toolbarbutton.bookmark-item:not(.subviewbutton):not(#bookmarks-menu-button),
#personal-bookmarks[cui-areatype="toolbar"]:not([overflowedItem=true]) > #bookmarks-toolbar-placeholder {
border: 0;
border-radius: 2.5px !important;
padding: 1px 8px !important;
margin: 0 0 1px;
font-weight: bold;
color: rgb(85, 85, 85);
@rtgibbons
rtgibbons / Dockerfile
Created Nov 8, 2013
Dockerfile for Ghost demo server on ubuntu 12.10
View Dockerfile
# DOCKER-VERSION 0.6.6
FROM ubuntu:12.10
# Install Node.js from Chris Lea's PPA to get v0.10.x
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y nodejs
ADD . /var/www
@rtgibbons
rtgibbons / logger.js
Created Nov 7, 2013
Logger Library with winston
View logger.js
var app = require(process.cwd() + '/app');
var winston = require('winston');
var _ = require('lodash');
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'green',
warn: 'yellow',
@rtgibbons
rtgibbons / customimpactsnippet.php
Created Sep 23, 2013
custom impact mysql error
View customimpactsnippet.php
public function getTotalDonationImpactOfUserIds($user_ids_array){
$queryGZ = "SELECT SUM(amount) FROM gz_donations where ";
$queryMGF = "SELECT SUM(amount) FROM mgf_donations where ";
for ($i=0; $i<count($user_ids_array); $i++){
$id = $this->db->escape($user_ids_array[$i]);
if ($i == count($user_ids_array) - 1) {
$queryGZ = $queryGZ . "referrer_user_id ='$id' OR donated_by_user_id ='$id'";
View rbenv-install-system-wide.sh
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
View Preferences.sublime-settings
{
"color_scheme": "Packages/Base16 Color Schemes/base16-eighties.dark.tmTheme",
"enable_telemetry": true,
"ensure_newline_at_eof_on_save": true,
"font_size": 12,
"git_command": "/opt/boxen/homebrew/bin/git",
"ignored_packages":
[
"Vintageous"
],
@rtgibbons
rtgibbons / Package Control.sublime-settings
Created Jul 15, 2013
SublimeText_PackageControl.sublime-settings
View Package Control.sublime-settings
{
"installed_packages":
[
"ApacheConf.tmLanguage",
"Base16 Color Schemes",
"Gist",
"GitGutter",
"JsFormat",
"nginx",
"Package Control",
@rtgibbons
rtgibbons / gist:5009517
Created Feb 21, 2013
grunt string-replace
View gist:5009517
'string-replace': {
optimized: {
files: {
'source/index.html': 'source/index.html'
},
options: {
replacements: [{
pattern: /static\/js\/main/,
replacement: 'static/js/main.optimized'
}]
View gist:3504782
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{request_uri} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301]
You can’t perform that action at this time.