Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View karuna's full-sized avatar
🦡
Badger Badger Badger

Karuna Murti karuna

🦡
Badger Badger Badger
View GitHub Profile
#app/helpers/application_helper.rb
module ApplicationHelper
def money_format money
number_to_currency(money.to_f, :unit => "£", :separator => ",", :delimiter => "", :precision => 2)
end
end
@karuna
karuna / Custom.css
Created March 12, 2012 02:33
IR_Black Theme for Chrome Developer Tools (modified)
/*
*
* Edited by Abderrahmane TAHRI JOUTI (tj.abderrahmane@gmail.com)
* http://abderrahmane-tj.co.cc
*
*/
/**********************************************/
/*
@karuna
karuna / Custom.css
Created March 12, 2012 02:38 — forked from bentruyman/Custom.css
Tomorrow Theme for Chrome Developer Tools
/**********************************************/
/*
/* Tomorrow Skin by Ben Truyman - 2011
/*
/* Based on Chris Kempson's Tomorrow Theme:
/* https://github.com/ChrisKempson/Tomorrow-Theme
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@karuna
karuna / gist:4147776
Created November 26, 2012 11:35
Github userstyles
.container, body.api #wrapper, body.platform-switch #content-wrapper, .container .discussion-timeline {
width:90% !important
}
#slider .frames .frame, #slider .frames, body.platform-switch #content-wrapper .site, .container .file-commit-form {
width:100% !important
}
.frame[style*="margin-left: -1200px;"] {
visibility: hidden !important;
display: none !important
}
require 'fileutils'
class MigrateUsersToPaperclip < ActiveRecord::Migration
def up
# Rename the old "mugshot" column to "old_file_name", since User.mugshot will now try to do Paperclip stuff
rename_column :users, :mugshot, :old_file_name
# Rename asset directories to pluralize
File.rename("public/system/user","public/system/users")

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@karuna
karuna / example.database.mysql.extra
Created November 23, 2013 03:54
database.yml collection
pool: number indicating size of connection pool (default 5)
checkout_timeout: number of seconds to block and wait for a connection before giving up and raising a timeout error (default 5 seconds).
reaping_frequency: frequency in seconds to periodically run the Reaper, which attempts to find and close dead connections, which can occur if a programmer forgets to close a connection at the end of a thread or a thread dies unexpectedly. (Default nil, which means don't run the Reaper).
dead_connection_timeout: number of seconds from last checkout after which the Reaper will consider a connection reapable. (default 5 seconds).
encoding: (Optional) Sets the client encoding by executing "SET NAMES <encoding>" after connection.
reconnect: Defaults to false (See MySQL documentation: dev.mysql.com/doc/refman/5.0/en/auto-reconnect.html).
strict: Defaults to true. Enable STRICT_ALL_TABLES. (See MySQL documentation: dev.mysql.com/doc/refman/5.0/en
# Ignore bundler config
/.bundle
/vendor/bundle/
/vendor/ruby/
# Ignore the default database.
/db/*.sqlite3
/db/*.javadb/
# Ignore all logfiles and tempfiles.

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@karuna
karuna / .gitconfig
Last active August 29, 2015 14:08
minimum git config
[core]
editor = vi
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%C(yellow)%h%Creset %ad | %Cgreen%s%Creset%d %Cred[%cn - %ce]%Creset\" --graph --date=iso --decorate
history = log --pretty=format:\"%C(yellow)%h%Creset %ad | %Cgreen%s%Creset%d %Cred[%cn - %ce]%Creset\" --graph --date=iso --decorate
type = cat-file -t